Skip to content

Commit 9f7488f

Browse files
committed
irqchip/mvebu-gicp: Use resource_size() for ioremap()
0-day reported an off by one in the ioremap() sizing: drivers/irqchip/irq-mvebu-gicp.c:240:45-48: WARNING: Suspicious code. resource_size is maybe missing with gicp -> res Convert it to resource_size(), which does the right thing. Fixes: 3c3d7db ("irqchip/mvebu-gicp: Clear pending interrupts on init") Reported-by: kernel test robot <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
1 parent 3b6a18f commit 9f7488f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-mvebu-gicp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
237237
return -ENODEV;
238238
}
239239

240-
base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
240+
base = ioremap(gicp->res->start, resource_size(gicp->res));
241241
if (IS_ERR(base)) {
242242
dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
243243
} else {

0 commit comments

Comments
 (0)