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

(cherry picked from commit 9f0c0e6eede6aedb60e12888fc9751c40b364dc9)

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
rGff01fd164655: Disable errors for -Wnonnull for the kernel for GCC 12.
Branches
Unknown
Tags
Unknown