aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/endpoint
diff options
context:
space:
mode:
authorGustavo Pimentel <gustavo.pimentel@synopsys.com>2018-07-19 10:32:22 +0200
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2018-07-19 11:47:25 +0100
commit15c972dfb3954569e7d17ebadf1b10d0a0c3baa3 (patch)
treec6b5c1673a37f7ce165ce11ad424b50db9708a2d /drivers/pci/endpoint
parenttools: PCI: Add MSI-X support (diff)
downloadlinux-dev-15c972dfb3954569e7d17ebadf1b10d0a0c3baa3.tar.xz
linux-dev-15c972dfb3954569e7d17ebadf1b10d0a0c3baa3.zip
PCI: endpoint: Add MSI set maximum restriction
Add pci_epc_set_msi() maximum 32 interrupts validation. Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/pci/endpoint')
-rw-r--r--drivers/pci/endpoint/pci-epc-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index c72e656e7e29..094dcc3203b8 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -201,7 +201,8 @@ int pci_epc_set_msi(struct pci_epc *epc, u8 func_no, u8 interrupts)
u8 encode_int;
unsigned long flags;
- if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
+ if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
+ interrupts > 32)
return -EINVAL;
if (!epc->ops->set_msi)