1
0
Fork 0

scsi: megaraid: silence a static checker bug

If we had more than 32 megaraid cards then it would cause memory
corruption.  That's not likely, of course, but it's handy to enforce it
and make the static checker happy.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
zero-colors
Dan Carpenter 2018-05-03 13:54:32 +03:00 committed by Martin K. Petersen
parent c09a21d8dd
commit 27e833daba
1 changed files with 3 additions and 0 deletions

View File

@ -4199,6 +4199,9 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
int irq, i, j;
int error = -ENODEV;
if (hba_count >= MAX_CONTROLLERS)
goto out;
if (pci_enable_device(pdev))
goto out;
pci_set_master(pdev);