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
This commit is contained in:
parent
e53fcff184
commit
9f0c0e6eed
@ -3980,6 +3980,7 @@ mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd)
|
||||
}
|
||||
}
|
||||
}
|
||||
sc->chan = NULL;
|
||||
|
||||
if (cmd->cmd_status == 0xFF) {
|
||||
device_printf(sc->mrsas_dev, "DCMD timed out after %d "
|
||||
|
Loading…
x
Reference in New Issue
Block a user