Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: rockchip: Fix find_first_zero_bit() limit

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: cf590b078391 ("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>

authored by

Dan Carpenter and committed by
Lorenzo Pieralisi
096950e2 31231092

+1 -2
+1 -2
drivers/pci/controller/pcie-rockchip-ep.c
··· 264 264 struct rockchip_pcie *pcie = &ep->rockchip; 265 265 u32 r; 266 266 267 - r = find_first_zero_bit(&ep->ob_region_map, 268 - sizeof(ep->ob_region_map) * BITS_PER_LONG); 267 + r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG); 269 268 /* 270 269 * Region 0 is reserved for configuration space and shouldn't 271 270 * be used elsewhere per TRM, so leave it out.