diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-03-15 09:58:29 +0300 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2022-04-08 16:38:07 +0300 |
commit | 0aa3a0937feeb91a0e4e438c3c063b749b194192 (patch) | |
tree | 03128e3d675e28caddc0c8e30254389514587cc3 /drivers/pci/controller/cadence | |
parent | 3123109284176b1532874591f7c81f3837bbdc17 (diff) | |
download | linux-0aa3a0937feeb91a0e4e438c3c063b749b194192.tar.xz |
PCI: cadence: Fix find_first_zero_bit() limit
The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
Link: https://lore.kernel.org/r/20220315065829.GA13572@kili
Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci/controller/cadence')
-rw-r--r-- | drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c index 88e05b9c2e5b..18e32b8ffd5e 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c @@ -187,8 +187,7 @@ static int cdns_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn, struct cdns_pcie *pcie = &ep->pcie; u32 r; - r = find_first_zero_bit(&ep->ob_region_map, - sizeof(ep->ob_region_map) * BITS_PER_LONG); + r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG); if (r >= ep->max_regions - 1) { dev_err(&epc->dev, "no free outbound region\n"); return -EINVAL; |