HomeFreeBSD

mrsas: Don't leak a stack pointer value in the softc.

Description

mrsas: Don't leak a stack pointer value in the softc.

mrsas_issue_blocked_cmd stores a pointer to an on-stack variable
in its softc so that the driver can call wakeup() on the correct
pointer. Once the loop around tsleep() has finished however, the
pointer is no longer needed and any further use would be invalid.
Clear sc->chan to NULL after the loop.

Reported by: GCC -Wdangling-pointer
Differential Revision: https://reviews.freebsd.org/D37628

Details

Provenance
jhbAuthored on Dec 21 2022, 6:45 PM
Differential Revision
D37628: mrsas: Don't leak a stack pointer value in the softc.
Parents
rGe53fcff1848b: bhyve: Simplify spinup_ap_realmode slightly.
Branches
Unknown
Tags
Unknown