Skip to content

Commit

Permalink
PCI: endpoint: Add MSI set maximum restriction
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gustavo Pimentel authored and Lorenzo Pieralisi committed Jul 19, 2018
1 parent 0653217 commit 15c972d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/endpoint/pci-epc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 15c972d

Please sign in to comment.