This is similar to commit 7a2ae008a53c ("scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS"). When cmdid == CMDID_INT_CMDS and status != 0 then mbox is still NULL but is dereferenced below. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Fixes: 0f2bb84d2a68 ("[SCSI] megaraid: simplify internal command handling") Signed-off-by: Maximilian Heyne <mheyne@xxxxxxxxx> --- Note: I have only compile tested this commit. Haven't tried reproducing it. drivers/scsi/megaraid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index e92f1a73cc9b..4dfe8865a18a 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1442,6 +1442,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) if (cmdid == CMDID_INT_CMDS) { scb = &adapter->int_scb; cmd = scb->cmd; + mbox = (mbox_t *)scb->raw_mbox; list_del_init(&scb->list); scb->state = SCB_FREE; -- 2.39.2 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879