public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] crypto: sha-mb - remove a bogus NULL check
@ 2014-11-22 18:36 Dan Carpenter
  2014-11-24 17:47 ` Tim Chen
  2014-11-25 14:56 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-11-22 18:36 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Tim Chen, Fengguang Wu, linux-crypto, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/arch/x86/crypto/sha-mb/sha1_mb.c b/arch/x86/crypto/sha-mb/sha1_mb.c
index 99eefd8..a225a5ca 100644
--- a/arch/x86/crypto/sha-mb/sha1_mb.c
+++ b/arch/x86/crypto/sha-mb/sha1_mb.c
@@ -204,8 +204,7 @@ static struct sha1_hash_ctx *sha1_ctx_mgr_resubmit(struct sha1_ctx_mgr *mgr, str
 			continue;
 		}
 
-		if (ctx)
-			ctx->status = HASH_CTX_STS_IDLE;
+		ctx->status = HASH_CTX_STS_IDLE;
 		return ctx;
 	}
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] crypto: sha-mb - remove a bogus NULL check
  2014-11-22 18:36 [patch] crypto: sha-mb - remove a bogus NULL check Dan Carpenter
@ 2014-11-24 17:47 ` Tim Chen
  2014-11-25 14:56 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Chen @ 2014-11-24 17:47 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Herbert Xu, David S. Miller, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, Fengguang Wu, linux-crypto, kernel-janitors

On Sat, 2014-11-22 at 21:36 +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>
> 
> diff --git a/arch/x86/crypto/sha-mb/sha1_mb.c b/arch/x86/crypto/sha-mb/sha1_mb.c
> index 99eefd8..a225a5ca 100644
> --- a/arch/x86/crypto/sha-mb/sha1_mb.c
> +++ b/arch/x86/crypto/sha-mb/sha1_mb.c
> @@ -204,8 +204,7 @@ static struct sha1_hash_ctx *sha1_ctx_mgr_resubmit(struct sha1_ctx_mgr *mgr, str
>  			continue;
>  		}
>  
> -		if (ctx)
> -			ctx->status = HASH_CTX_STS_IDLE;
> +		ctx->status = HASH_CTX_STS_IDLE;
>  		return ctx;
>  	}
>  

Agree.  This NULL pointer check is not necessary.

Acked-by: Tim Chen <tim.c.chen@linux.intel.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] crypto: sha-mb - remove a bogus NULL check
  2014-11-22 18:36 [patch] crypto: sha-mb - remove a bogus NULL check Dan Carpenter
  2014-11-24 17:47 ` Tim Chen
@ 2014-11-25 14:56 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2014-11-25 14:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David S. Miller, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Tim Chen, Fengguang Wu, linux-crypto, kernel-janitors

On Sat, Nov 22, 2014 at 09:36:28PM +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Patch applied.  Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-25 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-22 18:36 [patch] crypto: sha-mb - remove a bogus NULL check Dan Carpenter
2014-11-24 17:47 ` Tim Chen
2014-11-25 14:56 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox