Skip to contentSkip to conversation

crypto: essiv: remove redundant null pointer check before kfree

PATCH In review Chen Wandun 2 participants 2 messages Nov 16, 2019 – Nov 22, 2019 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: essiv: remove redundant null pointer check before kfree

kfree has taken null pointer check into account. so it is safe to remove the unnecessary check.

---
 crypto/essiv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
crypto/essiv.c +1 -2
index efea5af..75d810d 100644
@@ -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);
 }
 
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 7 lines · Chen Wandun

kfree has taken null pointer check into account. so it is safe to remove the unnecessary check.

---
 crypto/essiv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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