From: Himanshu Jha Date: Sat, 26 Aug 2017 21:15:30 +0000 (+0530) Subject: crypto: inside-secure - remove null check before kfree X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=18fddf5fd2111dd670156b3dfb2dfed16d7889b4;p=openwrt%2Fstaging%2Fblogic.git crypto: inside-secure - remove null check before kfree Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 3980f946874f..74feb6227101 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -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);