Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] crypto: essiv - Remove unnecessary NULL checks
@ 2019-09-06 12:25 YueHaibing
  0 siblings, 0 replies; only message in thread
From: YueHaibing @ 2019-09-06 12:25 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, kernel-janitors, YueHaibing

NULL check before kfree is not needed.
Generated-by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 crypto/essiv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crypto/essiv.c b/crypto/essiv.c
index a8befc8..3d3f9d7 100644
--- a/crypto/essiv.c
+++ b/crypto/essiv.c
@@ -188,8 +188,7 @@ static void essiv_aead_done(struct crypto_async_request *areq, int err)
 	struct aead_request *req = areq->data;
 	struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
 
-	if (rctx->assoc)
-		kfree(rctx->assoc);
+	kfree(rctx->assoc);
 	aead_request_complete(req, err);
 }
 
-- 
2.7.4



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 12:25 [PATCH -next] crypto: essiv - Remove unnecessary NULL checks YueHaibing

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org linux-crypto@archiver.kernel.org
	public-inbox-index linux-crypto


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/ public-inbox