Thread (859 messages) flat view 859 messages, 8 authors, 2021-11-16
STALE1735d REVIEWED: 1 (0M)

1 review trailer.

[PATCH 5.14 023/849] crypto: s5p-sss - Add error handling in s5p_aes_probe()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-11-15 21:21:50
Also in: lkml

From: Tang Bin <redacted>

commit a472cc0dde3eb057db71c80f102556eeced03805 upstream.

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: <redacted>
Signed-off-by: Tang Bin <redacted>
Reviewed-by: Krzysztof Kozlowski <redacted>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/crypto/s5p-sss.c |    2 ++
 1 file changed, 2 insertions(+)
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -2171,6 +2171,8 @@ static int s5p_aes_probe(struct platform
 
 	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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help