crypto: inside-secure - remove null check before kfree
authorHimanshu Jha <himanshujha199640@gmail.com>
Sat, 26 Aug 2017 21:15:30 +0000 (02:45 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Sep 2017 09:43:25 +0000 (17:43 +0800)
Kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_hash.c

index 3980f94..74feb62 100644 (file)
@@ -308,10 +308,8 @@ unmap_cache:
                ctx->base.cache_sz = 0;
        }
 free_cache:
-       if (ctx->base.cache) {
-               kfree(ctx->base.cache);
-               ctx->base.cache = NULL;
-       }
+       kfree(ctx->base.cache);
+       ctx->base.cache = NULL;
 
 unlock:
        spin_unlock_bh(&priv->ring[ring].egress_lock);