PCI: rockchip: fix find_first_zero_bit() limit
Subsystems (5)
PATCH 1/1 PCI: rockchip: fix find_first_zero_bit() limit
The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
Fixes cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/pci/controller/pcie-rockchip-ep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pcie-rockchip-ep.c +1 -2
@@ -264,8 +264,7 @@ static int rockchip_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn,struct rockchip_pcie *pcie = &ep->rockchip;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 );/* * Region 0 is reserved for configuration space and shouldn't * be used elsewhere per TRM, so leave it out.
Signature · 7 lines
2.20.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Lorenzo Pieralisi
AppliedQuoted 3 lines · Dan Carpenter
The
ep->ob_region_mapbitmap is a long and it hasBITS_PER_LONGbits.
Applied to pci/rockchip, thanks!
[1/1] PCI: rockchip: fix find_first_zero_bit() limit
https://git.kernel.org/lpieralisi/pci/c/096950e230
Thanks,
Lorenzo