[PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init()

Subsystems: irqchip drivers, microchip eic driver, the rest

STALE1742d LANDED

Landed in mainline as 68a6e0c63c76 on 2021-10-25.

4 messages, 3 authors, 2021-10-25 · open the first message on its own page

[PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init()

From: Yang Yingliang <hidden>
Date: 2021-10-25 04:53:07

In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <redacted>
---
 drivers/irqchip/irq-mchp-eic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c
index 09b7a8cdb611..c726a19837d2 100644
--- a/drivers/irqchip/irq-mchp-eic.c
+++ b/drivers/irqchip/irq-mchp-eic.c
@@ -209,7 +209,7 @@ static int mchp_eic_init(struct device_node *node, struct device_node *parent)
 		return -ENOMEM;
 
 	eic->base = of_iomap(node, 0);
-	if (IS_ERR(eic->base)) {
+	if (!eic->base) {
 		ret = -ENOMEM;
 		goto free;
 	}
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init()

From: <hidden>
Date: 2021-10-25 07:44:35

On 25.10.2021 08:00, Yang Yingliang wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.
Reviewed-by: Claudiu Beznea <redacted>

Thank you!
quoted hunk
---
 drivers/irqchip/irq-mchp-eic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c
index 09b7a8cdb611..c726a19837d2 100644
--- a/drivers/irqchip/irq-mchp-eic.c
+++ b/drivers/irqchip/irq-mchp-eic.c
@@ -209,7 +209,7 @@ static int mchp_eic_init(struct device_node *node, struct device_node *parent)
                return -ENOMEM;

        eic->base = of_iomap(node, 0);
-       if (IS_ERR(eic->base)) {
+       if (!eic->base) {
                ret = -ENOMEM;
                goto free;
        }
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init()

From: <hidden>
Date: 2021-10-25 09:40:27

On 25.10.2021 10:44, Claudiu Beznea - M18063 wrote:
On 25.10.2021 08:00, Yang Yingliang wrote:
quoted
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.
Reviewed-by: Claudiu Beznea <redacted>
Forgot to mention, can you add the Fixes tag?
Thank you!
quoted
---
 drivers/irqchip/irq-mchp-eic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c
index 09b7a8cdb611..c726a19837d2 100644
--- a/drivers/irqchip/irq-mchp-eic.c
+++ b/drivers/irqchip/irq-mchp-eic.c
@@ -209,7 +209,7 @@ static int mchp_eic_init(struct device_node *node, struct device_node *parent)
                return -ENOMEM;

        eic->base = of_iomap(node, 0);
-       if (IS_ERR(eic->base)) {
+       if (!eic->base) {
                ret = -ENOMEM;
                goto free;
        }
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init()

From: Marc Zyngier <maz@kernel.org>
Date: 2021-10-25 10:30:54

On Mon, 25 Oct 2021 10:40:15 +0100,
[off-list ref] wrote:
On 25.10.2021 10:44, Claudiu Beznea - M18063 wrote:
quoted
On 25.10.2021 08:00, Yang Yingliang wrote:
quoted
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.
Reviewed-by: Claudiu Beznea <redacted>
Forgot to mention, can you add the Fixes tag?
There is no real need for one when the offending patch is in the same
merge window, and will be in the same pull request.

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help