Skip to content

Commit 27e833d

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
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 <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c09a21d commit 27e833d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/megaraid.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,6 +4199,9 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
41994199
int irq, i, j;
42004200
int error = -ENODEV;
42014201

4202+
if (hba_count >= MAX_CONTROLLERS)
4203+
goto out;
4204+
42024205
if (pci_enable_device(pdev))
42034206
goto out;
42044207
pci_set_master(pdev);

0 commit comments

Comments
 (0)