* [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy()
@ 2018-07-30 2:42 Wei Yongjun
2018-07-30 6:18 ` Daniel Lezcano
2018-07-30 7:35 ` Miquel Raynal
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2018-07-30 2:42 UTC (permalink / raw)
To: kernel-janitors
In case of error, the function platform_get_resource() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Fixes: 175637792d45 ("thermal: armada: convert driver to syscon register accesses")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/thermal/armada_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 8de4ba5..6782814 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
/* First memory region points towards the status register */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (IS_ERR(res))
- return PTR_ERR(res);
+ if (!res)
+ return -EINVAL;
/*
* Edit the resource start address and length to map over all the
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy()
2018-07-30 2:42 [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy() Wei Yongjun
@ 2018-07-30 6:18 ` Daniel Lezcano
2018-07-30 7:35 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2018-07-30 6:18 UTC (permalink / raw)
To: kernel-janitors
On 30/07/2018 04:42, Wei Yongjun wrote:
> In case of error, the function platform_get_resource() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
>
> Fixes: 175637792d45 ("thermal: armada: convert driver to syscon register accesses")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy()
2018-07-30 2:42 [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy() Wei Yongjun
2018-07-30 6:18 ` Daniel Lezcano
@ 2018-07-30 7:35 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2018-07-30 7:35 UTC (permalink / raw)
To: kernel-janitors
Hi Daniel,
Daniel Lezcano <daniel.lezcano@linaro.org> wrote on Mon, 30 Jul 2018
08:18:53 +0200:
> On 30/07/2018 04:42, Wei Yongjun wrote:
> > In case of error, the function platform_get_resource() returns NULL
> > pointer not ERR_PTR(). The IS_ERR() test in the return value check
> > should be replaced with NULL test.
> >
> > Fixes: 175637792d45 ("thermal: armada: convert driver to syscon register accesses")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > ---
>
> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>
>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-30 7:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 2:42 [PATCH -next] thermal: armada: fix return value check in armada_thermal_probe_legacy() Wei Yongjun
2018-07-30 6:18 ` Daniel Lezcano
2018-07-30 7:35 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.