Skip to content

Commit

Permalink
scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOS…
Browse files Browse the repository at this point in the history
…T_DEVICE_LIST DCMD

Signed-off-by: Shivasharan S <[email protected]>
Signed-off-by: Chandrakanth Patil <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
cp890582 authored and martinkpetersen committed Jun 27, 2019
1 parent 59db5a9 commit a4413a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/megaraid/megaraid_sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a4413a5

Please sign in to comment.