Skip to contentSkip to conversation

megaraid: fix mega_cmd_done CMDID_INT_CMDS

PATCH Applied Danila Chernetsov 2 participants 2 messages Mar 17, 2023 – Apr 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 0f2bb84d2a68 ("[SCSI] megaraid: simplify internal command handling")
---
 drivers/scsi/megaraid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/megaraid.c +1 -0
index bf491af9f0d6..16e2cf848c6e 100644
@@ -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;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Danila Chernetsov

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

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

Applied to 6.4/scsi-queue, thanks!

[1/1] megaraid: fix mega_cmd_done CMDID_INT_CMDS

      https://git.kernel.org/mkp/scsi/c/75cb113cd43f
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering