]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mrsas: Don't leak a stack pointer value in the softc.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 21 Dec 2022 18:45:26 +0000 (10:45 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 21 Dec 2022 18:45:26 +0000 (10:45 -0800)
commit9f0c0e6eede6aedb60e12888fc9751c40b364dc9
tree78e309b567b91df3b2c74b4c118f9267b3cd0865
parente53fcff1848bb5acafc3dc38cfeb34724d9b0b96
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
sys/dev/mrsas/mrsas.c