* [PATCH -next] hwrng: geode - fix return value check in mod_init()
@ 2016-09-16 1:50 Wei Yongjun
2016-09-22 10:45 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2016-09-16 1:50 UTC (permalink / raw)
To: Matt Mackall, Herbert Xu, PrasannaKumar Muralidharan
Cc: Wei Yongjun, linux-geode, linux-crypto
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Fixes: 6e9b5e76882c ("hwrng: geode - Migrate to managed API")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/char/hw_random/geode-rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c
index 0cae210..e7a2459 100644
--- a/drivers/char/hw_random/geode-rng.c
+++ b/drivers/char/hw_random/geode-rng.c
@@ -95,8 +95,8 @@ static int __init mod_init(void)
return -ENODEV;
mem = devm_ioremap(&pdev->dev, rng_base, 0x58);
- if (IS_ERR(mem))
- return PTR_ERR(mem);
+ if (!mem)
+ return -ENOMEM;
geode_rng.priv = (unsigned long)mem;
pr_info("AMD Geode RNG detected\n");
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] hwrng: geode - fix return value check in mod_init()
2016-09-16 1:50 [PATCH -next] hwrng: geode - fix return value check in mod_init() Wei Yongjun
@ 2016-09-22 10:45 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2016-09-22 10:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: Matt Mackall, PrasannaKumar Muralidharan, Wei Yongjun,
linux-geode, linux-crypto
On Fri, Sep 16, 2016 at 01:50:01AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function devm_ioremap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
>
> Fixes: 6e9b5e76882c ("hwrng: geode - Migrate to managed API")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-22 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 1:50 [PATCH -next] hwrng: geode - fix return value check in mod_init() Wei Yongjun
2016-09-22 10:45 ` Herbert Xu
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.