PCI: rockchip: Fix find_first_zero_bit() limit
[ Upstream commit096950e230] The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits. Link: https://lore.kernel.org/r/20220315065944.GB13572@kili Fixes:cf590b0783("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
266f5cf692
commit
92b7cab307
@@ -264,8 +264,7 @@ static int rockchip_pcie_ep_map_addr(struct pci_epc *epc, u8 fn,
|
|||||||
struct rockchip_pcie *pcie = &ep->rockchip;
|
struct rockchip_pcie *pcie = &ep->rockchip;
|
||||||
u32 r;
|
u32 r;
|
||||||
|
|
||||||
r = find_first_zero_bit(&ep->ob_region_map,
|
r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG);
|
||||||
sizeof(ep->ob_region_map) * BITS_PER_LONG);
|
|
||||||
/*
|
/*
|
||||||
* Region 0 is reserved for configuration space and shouldn't
|
* Region 0 is reserved for configuration space and shouldn't
|
||||||
* be used elsewhere per TRM, so leave it out.
|
* be used elsewhere per TRM, so leave it out.
|
||||||
|
|||||||
Reference in New Issue
Block a user