diff --git a/MAINTAINERS b/MAINTAINERS index 7008ed37593d..5c0dc2b0413d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14136,7 +14136,7 @@ M: Lorenzo Pieralisi R: Rob Herring L: linux-pci@vger.kernel.org S: Supported -Q: http://patchwork.ozlabs.org/project/linux-pci/list/ +Q: http://patchwork.kernel.org/project/linux-pci/list/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/ F: drivers/pci/controller/ @@ -14144,7 +14144,7 @@ PCI SUBSYSTEM M: Bjorn Helgaas L: linux-pci@vger.kernel.org S: Supported -Q: http://patchwork.ozlabs.org/project/linux-pci/list/ +Q: http://patchwork.kernel.org/project/linux-pci/list/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git F: Documentation/PCI/ F: Documentation/devicetree/bindings/pci/ diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index ba52459928f7..bb6957101fc0 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1112,12 +1112,15 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev, if (copy_from_user(&p, up, sizeof(p))) return -EFAULT; - if (p.partition == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX) + if (p.partition == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX) { pcfg = stdev->mmio_part_cfg; - else if (p.partition < stdev->partition_count) + } else if (p.partition < stdev->partition_count) { + p.partition = array_index_nospec(p.partition, + stdev->partition_count); pcfg = &stdev->mmio_part_cfg_all[p.partition]; - else + } else { return -EINVAL; + } switch (p.port) { case 0: