summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2021-10-21 04:34:22 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-10-29 16:04:03 +0300
commita472cc0dde3eb057db71c80f102556eeced03805 (patch)
tree7da967b75e4022e8fef0730f27b9ac3e5995d37b /drivers/crypto
parentc9f608c38009062d7a7c8c48c7d43a328a4d9eee (diff)
downloadlinux-a472cc0dde3eb057db71c80f102556eeced03805.tar.xz
crypto: s5p-sss - Add error handling in s5p_aes_probe()
The function s5p_aes_probe() does not perform sufficient error checking after executing platform_get_resource(), thus fix it. Fixes: c2afad6c6105 ("crypto: s5p-sss - Add HASH support for Exynos") Cc: <stable@vger.kernel.org> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/s5p-sss.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 55aa3a71169b..7717e9e5977b 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -2171,6 +2171,8 @@ static int s5p_aes_probe(struct platform_device *pdev)
variant = find_s5p_sss_version(pdev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -EINVAL;
/*
* Note: HASH and PRNG uses the same registers in secss, avoid