Thread (2 messages) flat view 2 messages, 2 authors, 2021-10-20
STALE1792d

[PATCH] crypto: s5p-sss - Add error handling in s5p_aes_probe()

From: Tang Bin <hidden>
Date: 2021-10-20 10:04:06
Also in: linux-samsung-soc, lkml
Subsystem: crypto api, samsung s5p security subsystem (sss) driver, the rest · Maintainers: Herbert Xu, "David S. Miller", Krzysztof Kozlowski, Vladimir Zapolskiy, Linus Torvalds

The function s5p_aes_probe() does not perform sufficient error
checking after executing platform_get_resource(), thus fix it.

Signed-off-by: Tang Bin <redacted>
---
 drivers/crypto/s5p-sss.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 55aa3a711..7717e9e59 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
-- 
2.20.1.windows.1


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