Skip to content

Commit efe81b7

Browse files
Dan CarpenterKAGA-KOKO
authored andcommitted
irqchip/riscv-aplic: Fix an IS_ERR() vs NULL bug in probe()
The devm_platform_ioremap_resource() function doesn't return NULL, it returns error pointers. Fix the error handling to match. Fixes: 2333df5 ("irqchip: Add RISC-V advanced PLIC driver for direct-mode") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jinjie Ruan <[email protected]> Reviewed-by: Anup Patel <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/all/[email protected]
1 parent f97fd45 commit efe81b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/irqchip/irq-riscv-aplic-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ static int aplic_probe(struct platform_device *pdev)
175175

176176
/* Map the MMIO registers */
177177
regs = devm_platform_ioremap_resource(pdev, 0);
178-
if (!regs) {
178+
if (IS_ERR(regs)) {
179179
dev_err(dev, "failed map MMIO registers\n");
180-
return -ENOMEM;
180+
return PTR_ERR(regs);
181181
}
182182

183183
/*

0 commit comments

Comments
 (0)