From: Chen Ni Date: Wed, 6 May 2026 04:14:13 +0000 (+0800) Subject: irqchip/starfive: Fix error check for devm_platform_ioremap_resource() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b9db67396105f6b95bcc57a354e50ac20705704;p=thirdparty%2Flinux.git irqchip/starfive: Fix error check for devm_platform_ioremap_resource() devm_platform_ioremap_resource() returns an error pointer on failure, not NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly handle allocation failures. Fixes: 2f59ca185497 ("irqchip/starfive: Use devm_ interfaces to simplify resource release") Signed-off-by: Chen Ni Signed-off-by: Thomas Gleixner Reviewed-by: Changhuang Liang Link: https://patch.msgid.link/20260506041413.1670799-1-nichen@iscas.ac.cn --- diff --git a/drivers/irqchip/irq-starfive-jhb100-intc.c b/drivers/irqchip/irq-starfive-jhb100-intc.c index 0d5914813afd2..838885b02f343 100644 --- a/drivers/irqchip/irq-starfive-jhb100-intc.c +++ b/drivers/irqchip/irq-starfive-jhb100-intc.c @@ -208,8 +208,8 @@ static int starfive_intc_probe(struct platform_device *pdev, struct device_node return -ENOMEM; irqc->base = devm_platform_ioremap_resource(pdev, 0); - if (!irqc->base) - return dev_err_probe(&pdev->dev, -ENXIO, "unable to map registers\n"); + if (IS_ERR(irqc->base)) + return dev_err_probe(&pdev->dev, PTR_ERR(irqc->base), "unable to map registers\n"); rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL); if (IS_ERR(rst))