crypto: fix potential null pointer dereference on pointer dd
Subsystems (2)
PATCH 1/1 crypto: fix potential null pointer dereference on pointer dd
The return pointer of atmel_sha_find_dev could be null, there could be potential null-deref issue. Fix this by adding a null check.
Signed-off-by Chengfeng Ye <[email protected]>
--- drivers/crypto/atmel-sha.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/crypto/atmel-sha.c +3 -0
@@ -430,6 +430,9 @@ static int atmel_sha_init(struct ahash_request *req)struct atmel_sha_reqctx *ctx =ahash_request_ctx (req);struct atmel_sha_dev *dd =atmel_sha_find_dev (tctx); +if (!dd) +return -EINVAL ; + ctx->dd = dd; ctx->flags =0 ;
Signature · 1 line
2.17.1
Herbert Xu
maintainerQuoted 8 lines · Chengfeng Ye
The return pointer of
atmel_sha_find_devcould be null, there could be potential null-deref issue. Fix this by adding a null check.Signed-off-by Chengfeng Ye <[email protected]>--- drivers/crypto/atmel-sha.c | 3 +++ 1 file changed, 3 insertions(+)
You forgot to cc linux-crypto.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt