mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
scsi: megaraid: silence a static checker bug
[ Upstream commit 27e833daba ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2c29ed3304
commit
4005ecaf46
@@ -4197,6 +4197,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);
|
||||
|
||||
Reference in New Issue
Block a user