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: 6e9b5e7688
("hwrng: geode - Migrate to managed API")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -95,8 +95,8 @@ static int __init mod_init(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mem = devm_ioremap(&pdev->dev, rng_base, 0x58);
|
mem = devm_ioremap(&pdev->dev, rng_base, 0x58);
|
||||||
if (IS_ERR(mem))
|
if (!mem)
|
||||||
return PTR_ERR(mem);
|
return -ENOMEM;
|
||||||
geode_rng.priv = (unsigned long)mem;
|
geode_rng.priv = (unsigned long)mem;
|
||||||
|
|
||||||
pr_info("AMD Geode RNG detected\n");
|
pr_info("AMD Geode RNG detected\n");
|
||||||
|
Reference in New Issue
Block a user