Skip to contentSkip to conversation

scsi: megaraid_sas: fix for a crash after a double completion

PATCH Applied Tomas Henzl 2 participants 2 messages Mar 24, 2023 – Mar 25, 2023

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

PATCH 1/1 scsi: megaraid_sas: fix for a crash after a double completion

When a physical disk is attached directly "without JBOD MAP support" (see megasas_get_tm_devhandle) then there is no real error handling in the driver.
Return FAILED instead of SUCCESS.

Fixes 18365b138508 ("megaraid_sas: Task management support")
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +2 -2
index 6597e118c805..52b71eb3fd34 100644
@@ -4768,7 +4768,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd)
 	devhandle = megasas_get_tm_devhandle(scmd->device);
 
 	if (devhandle == (u16)ULONG_MAX) {
-		ret = SUCCESS;
+		ret = FAILED;
 		sdev_printk(KERN_INFO, scmd->device,
 			"task abort issued for invalid devhandle\n");
 		mutex_unlock(&instance->reset_mutex);
@@ -4838,7 +4838,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd)
 	devhandle = megasas_get_tm_devhandle(scmd->device);
 
 	if (devhandle == (u16)ULONG_MAX) {
-		ret = SUCCESS;
+		ret = FAILED;
 		sdev_printk(KERN_INFO, scmd->device,
 			"target reset issued for invalid devhandle\n");
 		mutex_unlock(&instance->reset_mutex);
Signature · 1 line
2.39.1
#1 lore raw
Quoted 8 lines · Tomas Henzl

When a physical disk is attached directly "without JBOD MAP support" (see megasas_get_tm_devhandle) then there is no real error handling in the driver.
Return FAILED instead of SUCCESS.

Fixes 18365b138508 ("megaraid_sas: Task management support")

[...]

Applied to 6.3/scsi-fixes, thanks!

[1/1] scsi: megaraid_sas: fix for a crash after a double completion

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