Skip to content

Commit

Permalink
irqchip/riscv-aplic: Fix an IS_ERR() vs NULL bug in probe()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/a5a628d6-81d8-4933-81a8-64aad4743ec4@stanley.mountain
  • Loading branch information
Dan Carpenter authored and Thomas Gleixner committed Aug 20, 2024
1 parent f97fd45 commit efe81b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-riscv-aplic-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ static int aplic_probe(struct platform_device *pdev)

/* Map the MMIO registers */
regs = devm_platform_ioremap_resource(pdev, 0);
if (!regs) {
if (IS_ERR(regs)) {
dev_err(dev, "failed map MMIO registers\n");
return -ENOMEM;
return PTR_ERR(regs);
}

/*
Expand Down

0 comments on commit efe81b7

Please sign in to comment.