Skip to contentSkip to conversation

PCI: cadence: Fix find_first_zero_bit() limit

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 15, 2022 – Apr 8, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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")
---
 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
index 88e05b9c2e5b..18e32b8ffd5e 100644
@@ -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