diff mbox series

PCI: cadence: Fix find_first_zero_bit() limit

Message ID 20220315065829.GA13572@kili (mailing list archive)
State Accepted
Delegated to: Lorenzo Pieralisi
Headers show
Series PCI: cadence: Fix find_first_zero_bit() limit | expand

Commit Message

Dan Carpenter March 15, 2022, 6:58 a.m. UTC
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 <dan.carpenter@oracle.com>
---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Lorenzo Pieralisi April 8, 2022, 1:39 p.m. UTC | #1
On Tue, 15 Mar 2022 09:58:29 +0300, Dan Carpenter wrote:
> The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
> 
> 

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
diff mbox series

Patch

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;