summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Henzl <thenzl@redhat.com>2023-03-24 16:01:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-05 11:23:47 +0200
commit6ff4a54c0218a2e23b808648a3c0689589d0c502 (patch)
tree497fa5838bfc3f50fd6a92c7ec3169c3a9d8d3de
parent059c3a7a3d6ddc48f6b93c21bdfb6585bc2a6888 (diff)
downloadlinux-stable-6ff4a54c0218a2e23b808648a3c0689589d0c502.tar.gz
linux-stable-6ff4a54c0218a2e23b808648a3c0689589d0c502.tar.bz2
linux-stable-6ff4a54c0218a2e23b808648a3c0689589d0c502.zip
scsi: megaraid_sas: Fix crash after a double completion
[ Upstream commit 2309df27111a51734cb9240b4d3c25f2f3c6ab06 ] 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") Signed-off-by: Tomas Henzl <thenzl@redhat.com> Link: https://lore.kernel.org/r/20230324150134.14696-1-thenzl@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 7838c7911add..8eb126d48462 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -4656,7 +4656,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);
@@ -4726,7 +4726,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);