Skip to content

Commit a8913d5

Browse files
Lorenzo PieralisiKAGA-KOKO
authored andcommitted
irqchip/gic-v5: iwb: Fix iounmap probe failure path
The 0-day bot reported that on the failure path the driver iounmap()s IWB resources that are managed through devm_ioremap(), which is clearly wrong because the driver would end up unmapping the MMIO resource twice on probing failure. Fix this by removing the error path altogether and by letting devres manage the iounmapping on clean-up. Fixes: 695949d ("irqchip/gic-v5: Add GICv5 IWB support") Reported-by: kernel test robot <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/all/[email protected] Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]
1 parent 3c3d7db commit a8913d5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/irqchip/irq-gic-v5-iwb.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ static int gicv5_iwb_device_probe(struct platform_device *pdev)
241241
struct gicv5_iwb_chip_data *iwb_node;
242242
void __iomem *iwb_base;
243243
struct resource *res;
244-
int ret;
245244

246245
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
247246
if (!res)
@@ -254,16 +253,10 @@ static int gicv5_iwb_device_probe(struct platform_device *pdev)
254253
}
255254

256255
iwb_node = gicv5_iwb_init_bases(iwb_base, pdev);
257-
if (IS_ERR(iwb_node)) {
258-
ret = PTR_ERR(iwb_node);
259-
goto out_unmap;
260-
}
256+
if (IS_ERR(iwb_node))
257+
return PTR_ERR(iwb_node);
261258

262259
return 0;
263-
264-
out_unmap:
265-
iounmap(iwb_base);
266-
return ret;
267260
}
268261

269262
static const struct of_device_id gicv5_iwb_of_match[] = {

0 commit comments

Comments
 (0)