From: Don Brace Date: Thu, 4 May 2017 22:50:50 +0000 (-0500) Subject: scsi: hpsa: do not get enclosure info for external devices X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ac517b8a2c592a3a6e3928de7b868c52b200444;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git scsi: hpsa: do not get enclosure info for external devices external shelves do not support BMICs. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 73daace478cb..8e22aed09adb 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3353,6 +3353,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); + if (encl_dev->target == -1 || encl_dev->lun == -1) { + rc = IO_OK; + goto out; + } + if (bmic_device_index == 0xFF00 || MASKED_DEVICE(&rle->lunid[0])) { rc = IO_OK; goto out;