diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-09-15 21:50:01 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-09-22 06:27:49 -0400 |
commit | 104a32e85f250742bc37e14d19a5dec706bed76e (patch) | |
tree | 57e27f6f1c27041842e6f330bd04b8d7347691c4 | |
parent | f7eca278a8f81e701848392b522f80078bf2589f (diff) |
hwrng: geode - fix return value check in mod_init()
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/char/hw_random/geode-rng.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index 0cae21086c05..e7a245942029 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) | |||
95 | return -ENODEV; | 95 | return -ENODEV; |
96 | 96 | ||
97 | mem = devm_ioremap(&pdev->dev, rng_base, 0x58); | 97 | mem = devm_ioremap(&pdev->dev, rng_base, 0x58); |
98 | if (IS_ERR(mem)) | 98 | if (!mem) |
99 | return PTR_ERR(mem); | 99 | return -ENOMEM; |
100 | geode_rng.priv = (unsigned long)mem; | 100 | geode_rng.priv = (unsigned long)mem; |
101 | 101 | ||
102 | pr_info("AMD Geode RNG detected\n"); | 102 | pr_info("AMD Geode RNG detected\n"); |