diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2022-01-13 09:57:47 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-01-13 09:57:47 -0600 |
commit | 28b75189f038af1392142906d9ff29bea46f8e4c (patch) | |
tree | e357ced5a07e8e011ea27f143f519d9d47472a2a /drivers/pci | |
parent | 2948ce70e636d3803a17baa25d5e7d1e8ec844ae (diff) | |
parent | 50b620303a14e885529410d26800f92a735724d6 (diff) | |
download | linux-28b75189f038af1392142906d9ff29bea46f8e4c.tar.bz2 |
Merge branch 'remotes/lorenzo/pci/endpoint'
- Return failure from pci_epc_set_msi() if no interrupts are available (Li
Chen)
* remotes/lorenzo/pci/endpoint:
PCI: endpoint: Return -EINVAL when interrupts num is smaller than 1
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/endpoint/pci-epc-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index 38621558d397..3bc9273d0a08 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -334,7 +334,7 @@ int pci_epc_set_msi(struct pci_epc *epc, u8 func_no, u8 vfunc_no, u8 interrupts) u8 encode_int; if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions || - interrupts > 32) + interrupts < 1 || interrupts > 32) return -EINVAL; if (vfunc_no > 0 && (!epc->max_vfs || vfunc_no > epc->max_vfs[func_no])) |