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>
This commit is contained in:
Chandrakanth Patil 2019-06-25 16:34:27 +05:30 committed by Martin K. Petersen
parent 59db5a931b
commit a4413a5859
1 changed files with 3 additions and 0 deletions

View File

@ -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);