[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7d5a9708368226edd1d461dec4b719ea5bffdf6c.1531818979.git.gustavo.pimentel@synopsys.com>
Date: Tue, 17 Jul 2018 11:31:32 +0200
From: Gustavo Pimentel <gustavo.pimentel@...opsys.com>
To: bhelgaas@...gle.com, lorenzo.pieralisi@....com,
joao.pinto@...opsys.com, jingoohan1@...il.com, kishon@...com,
adouglas@...ence.com, jesper.nilsson@...s.com,
shawn.lin@...k-chips.com
Cc: linux-pci@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>
Subject: [PATCH v12 12/12] PCI: endpoint: Add MSI set maximum restriction
Add pci_epc_set_msi() maximum 32 interrupts validation.
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@...opsys.com>
Acked-by: Kishon Vijay Abraham I <kishon@...com>
---
Change v4->v5:
- New patch file.
Change v5->v6:
- Nothing changed, just to follow the patch set version.
Change v6->v7:
- Nothing changed, just to follow the patch set version.
Change v7->v8:
- Re-sending the patch series.
Change v8->v9:
- Nothing changed, just to follow the patch set version.
Change v9->v10:
- Nothing changed, just to follow the patch set version.
Change v10->v11:
- Nothing changed, just to follow the patch set version.
Change v11->v12:
- Nothing changed, just to follow the patch set version.
drivers/pci/endpoint/pci-epc-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index c72e656..094dcc3 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)
--
2.7.4
Powered by blists - more mailing lists