[PATCH 1/5] scsi: megaraid_sas: correct the parameter of scsi_device_lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a delete event is received, find the scsi_device and remove it,
the scsi_device_lookup`s parameter id should be "ld_target_id %
MEGASAS_MAX_DEV_PER_CHANNEL".

Fixes: ae6874ba4b43 ("scsi: megaraid_sas: Early detection of VD deletion through RaidMap update")
Signed-off-by: Guixin Liu <kanie@xxxxxxxxxxxxxxxxx>

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 7f8632c..44d5e93 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -8922,7 +8922,7 @@ void megasas_add_remove_devices(struct megasas_instance *instance,
 			sdev1 = scsi_device_lookup(instance->host,
 						   MEGASAS_MAX_PD_CHANNELS +
 						   (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
-						   (ld_target_id - MEGASAS_MAX_DEV_PER_CHANNEL),
+						   (ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL),
 						   0);
 			dev_info(&instance->pdev->dev, "Debug_lgx: ld_target_id:%u, sdev1:%p.\n",
                                ld_target_id, sdev1);
-- 
1.8.3.1




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux