mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
mrsas: Fix callout locking in mrsas_complete_cmd()
callout_stop() requires the associated lock to be held.
This is a bit hacky, but I believe it's safe since the subsequent
mrsas_cmd_done() call will also acquire the SIM lock to stop a different
callout.
PR: 265484
Reviewed by: imp
Tested by: Jérémie Jourdin <jeremie.jourdin@advens.fr>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39559
(cherry picked from commit 4640df1b0a)
This commit is contained in:
parent
bdd19ce53c
commit
29de7af6ee
1 changed files with 2 additions and 0 deletions
|
|
@ -1732,11 +1732,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex)
|
|||
data_length = r1_cmd->io_request->DataLength;
|
||||
sense = r1_cmd->sense;
|
||||
}
|
||||
mtx_lock(&sc->sim_lock);
|
||||
r1_cmd->ccb_ptr = NULL;
|
||||
if (r1_cmd->callout_owner) {
|
||||
callout_stop(&r1_cmd->cm_callout);
|
||||
r1_cmd->callout_owner = false;
|
||||
}
|
||||
mtx_unlock(&sc->sim_lock);
|
||||
mrsas_release_mpt_cmd(r1_cmd);
|
||||
mrsas_atomic_dec(&sc->fw_outstanding);
|
||||
mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status,
|
||||
|
|
|
|||
Loading…
Reference in a new issue