From: Tang Bin <tangbin@cmss.chinamobile.com>
To: krzysztof.kozlowski@canonical.com, vz@mleia.com,
herbert@gondor.apana.org.au, davem@davemloft.net
Cc: linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Tang Bin <tangbin@cmss.chinamobile.com>
Subject: [PATCH v2] crypto: s5p-sss - Add error handling in s5p_aes_probe()
Date: Wed, 20 Oct 2021 19:06:24 +0800 [thread overview]
Message-ID: <20211020110624.47696-1-tangbin@cmss.chinamobile.com> (raw)
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")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
Changes from v1
- add fixed title
---
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
next reply other threads:[~2021-10-20 11:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 11:06 Tang Bin [this message]
2021-10-20 11:38 ` [PATCH v2] crypto: s5p-sss - Add error handling in s5p_aes_probe() Krzysztof Kozlowski
2021-10-21 1:20 ` [PATCH v2] crypto: s5p-sss - Add error handling ins5p_aes_probe() tangbin
2021-10-20 12:12 ` [PATCH v2] crypto: s5p-sss - Add error handling in s5p_aes_probe() Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211020110624.47696-1-tangbin@cmss.chinamobile.com \
--to=tangbin@cmss.chinamobile.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=krzysztof.kozlowski@canonical.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vz@mleia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).