Thread (5 messages) 5 messages, 2 authors, 2018-01-29
STALE3091d

[PATCH 3/3] scsi: hisi_sas: fix a bug in hisi_sas_dev_gone()

From: John Garry <hidden>
Date: 2018-01-17 15:54:49
Also in: linux-scsi, lkml
Subsystem: hisilicon sas controller, scsi subsystem, the rest · Maintainers: Yihang Li, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

From: Xiang Chen <redacted>

When device gone, NULL pointer can be accessed in
free_device callback if during SAS controller reset
as we clear structure sas_dev prior.

Actually we can only set dev_type as SAS_PHY_UNUSED
and not clear structure sas_dev as all the members
of structure sas_dev will be re-initialized after
device found.

Signed-off-by: Xiang Chen <redacted>
Signed-off-by: John Garry <redacted>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 791462d..2d4dbed 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -796,7 +796,6 @@ static void hisi_sas_dev_gone(struct domain_device *device)
 
 		hisi_hba->hw->clear_itct(hisi_hba, sas_dev);
 		device->lldd_dev = NULL;
-		memset(sas_dev, 0, sizeof(*sas_dev));
 	}
 
 	if (hisi_hba->hw->free_device)
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help