Commit 75cb113c authored by Danila Chernetsov's avatar Danila Chernetsov Committed by Martin K. Petersen

scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS

When cmdid == CMDID_INT_CMDS, the 'cmds' pointer is NULL but is
dereferenced below.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 0f2bb84d ("[SCSI] megaraid: simplify internal command handling")
Signed-off-by: default avatarDanila Chernetsov <listdansp@mail.ru>
Link: https://lore.kernel.org/r/20230317175109.18585-1-listdansp@mail.ruSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 62d15dba
......@@ -1441,6 +1441,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;
list_del_init(&scb->list);
scb->state = SCB_FREE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment