From: Tang Bin Date: Thu, 21 Oct 2021 01:34:22 +0000 (+0800) Subject: crypto: s5p-sss - Add error handling in s5p_aes_probe() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a472cc0dde3eb057db71c80f102556eeced03805;p=linux.git 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: Signed-off-by: Tang Bin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 55aa3a71169b0..7717e9e5977bb 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