OSDN Git Service

scsi: hisi_sas: Relocate some codes to avoid an unused check
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 9 Nov 2018 14:06:35 +0000 (22:06 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 15 Nov 2018 19:37:05 +0000 (14:37 -0500)
commit745b6847634c11dda1079d0290781a443eddb4b7
tree8f4af7c00328116c1851b3fd74061d6a06a02182
parent37359798ec44ae03fab383a9bef3b7c9df819063
scsi: hisi_sas: Relocate some codes to avoid an unused check

In function hisi_sas_task_prep(), we check asd_sas_port, but in function
hisi_sas_task_exec(), we already refer to asd_sas_port by using function
dev_to_hisi_hba() implicitly. So to avoid this possible invalid
dereference, relocate the check to function hisi_sas_task_prep().

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