summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChandrakanth Patil <chandrakanth.patil@broadcom.com>2019-06-25 13:04:27 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-06-27 06:07:35 +0200
commita4413a5859f8a36e9217e808d172e9458ece4ff0 (patch)
tree3ee3fa55355af8f38efe72f0fd38dc8d5e0e00d8 /drivers
parentscsi: megaraid_sas: Handle sequence JBOD map failure at driver level (diff)
downloadlinux-a4413a5859f8a36e9217e808d172e9458ece4ff0.tar.xz
linux-a4413a5859f8a36e9217e808d172e9458ece4ff0.zip
scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 554ec72811e7..a886de3e3ffb 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4827,6 +4827,9 @@ megasas_host_device_list_query(struct megasas_instance *instance,
*/
count = le32_to_cpu(ci->count);
+ if (count > (MEGASAS_MAX_PD + MAX_LOGICAL_DRIVES_EXT))
+ break;
+
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "%s, Device count: 0x%x\n",
__func__, count);