Skip to content

Commit 2309df2

Browse files
thenzlmartinkpetersen
authored andcommitted
scsi: megaraid_sas: Fix 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: 18365b1 ("megaraid_sas: Task management support") Signed-off-by: Tomas Henzl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0808ed6 commit 2309df2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,7 +4771,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd)
47714771
devhandle = megasas_get_tm_devhandle(scmd->device);
47724772

47734773
if (devhandle == (u16)ULONG_MAX) {
4774-
ret = SUCCESS;
4774+
ret = FAILED;
47754775
sdev_printk(KERN_INFO, scmd->device,
47764776
"task abort issued for invalid devhandle\n");
47774777
mutex_unlock(&instance->reset_mutex);
@@ -4841,7 +4841,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd)
48414841
devhandle = megasas_get_tm_devhandle(scmd->device);
48424842

48434843
if (devhandle == (u16)ULONG_MAX) {
4844-
ret = SUCCESS;
4844+
ret = FAILED;
48454845
sdev_printk(KERN_INFO, scmd->device,
48464846
"target reset issued for invalid devhandle\n");
48474847
mutex_unlock(&instance->reset_mutex);

0 commit comments

Comments
 (0)