aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ux500/hash/hash_core.c
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-03-06 03:22:04 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2016-03-11 21:19:20 +0800
commitb62917a2622ebcb03a500ef20da47be80d8c8951 (patch)
treeda726d1f461ac632f47177d2a34000c491d0bc9f /drivers/crypto/ux500/hash/hash_core.c
parentcrypto: atmel - fix checks of error code returned by devm_ioremap_resource() (diff)
downloadlinux-dev-b62917a2622ebcb03a500ef20da47be80d8c8951.tar.xz
linux-dev-b62917a2622ebcb03a500ef20da47be80d8c8951.zip
crypto: ux500 - fix checks of error code returned by devm_ioremap_resource()
The change fixes potential oops while accessing iomem on invalid address, if devm_ioremap_resource() fails due to some reason. The devm_ioremap_resource() function returns ERR_PTR() and never returns NULL, which makes useless a following check for NULL. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Fixes: 5a4eea2658c93 ("crypto: ux500 - Use devm_xxx() managed function") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ux500/hash/hash_core.c')
-rw-r--r--drivers/crypto/ux500/hash/hash_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index d6fdc583ce5d..574e87c7f2b8 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -1659,9 +1659,9 @@ static int ux500_hash_probe(struct platform_device *pdev)
device_data->phybase = res->start;
device_data->base = devm_ioremap_resource(dev, res);
- if (!device_data->base) {
+ if (IS_ERR(device_data->base)) {
dev_err(dev, "%s: ioremap() failed!\n", __func__);
- ret = -ENOMEM;
+ ret = PTR_ERR(device_data->base);
goto out;
}
spin_lock_init(&device_data->ctx_lock);