aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/parisc/kernel/drivers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 6afb595e0d86..3b8507f71050 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -651,6 +651,10 @@ static int match_pci_device(struct device *dev, int index,
651 (modpath->mod == PCI_FUNC(devfn))); 651 (modpath->mod == PCI_FUNC(devfn)));
652 } 652 }
653 653
654 /* index might be out of bounds for bc[] */
655 if (index >= 6)
656 return 0;
657
654 id = PCI_SLOT(pdev->devfn) | (PCI_FUNC(pdev->devfn) << 5); 658 id = PCI_SLOT(pdev->devfn) | (PCI_FUNC(pdev->devfn) << 5);
655 return (modpath->bc[index] == id); 659 return (modpath->bc[index] == id);
656} 660}