PCI: cadence: Fix find_first_zero_bit() limit
Subsystems (4)
PATCH 1/1 PCI: cadence: Fix find_first_zero_bit() limit
The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
Fixes 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-ep.c +1 -2
@@ -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 ;
Signature · 1 line
2.20.1
Lorenzo Pieralisi
AppliedQuoted 3 lines · Dan Carpenter
The
ep->ob_region_mapbitmap is a long and it hasBITS_PER_LONGbits.
Applied to pci/cadence, thanks!
[1/1] PCI: cadence: Fix find_first_zero_bit() limit
https://git.kernel.org/lpieralisi/pci/c/0aa3a0937f
Thanks,
Lorenzo