HomeFreeBSD

sdhci: Fix crash caused by M_WAITOK in sdhci dumps

Description

sdhci: Fix crash caused by M_WAITOK in sdhci dumps

In some contexts it is illegal to wait for memory allocation, causing
kernel panic. By default sbuf_new passes M_WAITOK to malloc,
which caused crashes when sdhci_dumpcaps or sdhci_dumpregs was callend in
non sutiable context.

Add SBUF_NOWAIT flag to sbuf_new to fix this.

Obtained from: Semihalf
Differential revision: https://reviews.freebsd.org/D32075

Details

Provenance
bag_semihalf.comAuthored on Oct 5 2021, 4:22 AM
wmaCommitted on Oct 5 2021, 4:22 AM
Differential Revision
D32075: sdhci: Fix crash caused by M_WAITOK in sdhci dumps
Parents
rGbe6116fdfc4d: pthread_mutexattr(3): document each pthread_mutexattr_set/get* function
Branches
Unknown
Tags
Unknown