]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: hisi_sas: fix a bug in hisi_sas_dev_gone()
authorXiang Chen <chenxiang66@hisilicon.com>
Wed, 17 Jan 2018 16:46:54 +0000 (00:46 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 23 Jan 2018 01:03:59 +0000 (20:03 -0500)
commit0d762b3af2a5b5095fec18aa4d61f408638aa9ca
tree2568d279b38e9ae91b8a73adc2260bd0c1621611
parent6379c56070b9ee32ae2b3efa51e121242042e72d
scsi: hisi_sas: fix a bug in hisi_sas_dev_gone()

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 <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c