]> git.baikalelectronics.ru Git - kernel.git/commitdiff
irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 16 Mar 2022 02:51:00 +0000 (10:51 +0800)
committerMarc Zyngier <maz@kernel.org>
Tue, 5 Apr 2022 15:33:13 +0000 (16:33 +0100)
If devm_platform_ioremap_resource() fails, it never returns
NULL, replace NULL check with IS_ERR().

Fixes: a53185d3d3a5 ("irqchip: Add Qualcomm MPM controller driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220316025100.1758413-1-yangyingliang@huawei.com
drivers/irqchip/irq-qcom-mpm.c

index eea5a753618c5e1f5a376d0514a8359507a4ee0d..d30614661eea69242c78a8e46d9952d40508a72c 100644 (file)
@@ -375,7 +375,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
        raw_spin_lock_init(&priv->lock);
 
        priv->base = devm_platform_ioremap_resource(pdev, 0);
-       if (!priv->base)
+       if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
        for (i = 0; i < priv->reg_stride; i++) {