crypto: sha-mb - remove a bogus NULL check
Subsystems (3)
PATCH 1/1 crypto: sha-mb - remove a bogus NULL check
This can't be NULL and we dereferenced it earlier. Smatch used to ignore these things where the pointer was obviously non-NULL but I've found that sometimes the intention was to check something else so we were maybe missing bugs.
arch/x86/crypto/sha-mb/sha1_mb.c +1 -2
@@ -204,8 +204,7 @@ static struct sha1_hash_ctx *sha1_ctx_mgr_resubmit(struct sha1_ctx_mgr *mgr, strcontinue ; } -if (ctx) - ctx->status =HASH_CTX_STS_IDLE ; + ctx->status =HASH_CTX_STS_IDLE ;return ctx; }
Quoted 12 lines · Dan Carpenter
This can't be NULL and we dereferenced it earlier. Smatch used to ignore these things where the pointer was obviously non-NULL but I've found that sometimes the intention was to check something else so we were maybe missing bugs.
Signed-off-by Dan Carpenter <[email protected]>arch/x86/crypto/sha-mb/sha1_mb.c +0
-0
arch/x86/crypto/sha-mb/sha1_mb.c static struct sha1_hash_ctx *sha1_ctx_mgr_resubmit(struct sha1_ctx_mgr *mgr, str · line 210
Quoted 9 lines
arch/x86/crypto/sha-mb/sha1_mb.c +1
-2@@ -204,8 +204,7 @@ static struct sha1_hash_ctx *sha1_ctx_mgr_resubmit(struct sha1_ctx_mgr *mgr, strcontinue ; } -if (ctx) - ctx->status =HASH_CTX_STS_IDLE ; + ctx->status =HASH_CTX_STS_IDLE ;return ctx; }
Agree. This NULL pointer check is not necessary.
Herbert Xu
maintainerQuoted 6 lines · Dan Carpenter
This can't be NULL and we dereferenced it earlier. Smatch used to ignore these things where the pointer was obviously non-NULL but I've found that sometimes the intention was to check something else so we were maybe missing bugs.
Signed-off-by Dan Carpenter <[email protected]>
Patch applied. 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