diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 6afb595e0d86c47e0105606bb544ca6a83188617..3b8507f710507dcd141d0d11f550d53722a0bd7c 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, (modpath->mod == PCI_FUNC(devfn))); } + /* index might be out of bounds for bc[] */ + if (index >= 6) + return 0; + id = PCI_SLOT(pdev->devfn) | (PCI_FUNC(pdev->devfn) << 5); return (modpath->bc[index] == id); }