mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: kbuild-all@01.org, "Theodore Ts'o" <tytso@mit.edu>,
	Michael Halcrow <mhalcrow@google.com>,
	Ildar Muslukhov <ildarm@google.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fs crypto: fix ifnullfree.cocci warnings
Date: Wed, 17 Feb 2016 08:32:56 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1602170831430.2685@hadrien> (raw)

 NULL check before some freeing functions is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

---

 crypto.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/fs/crypto/crypto.c
+++ b/fs/crypto/crypto.c
@@ -414,8 +414,7 @@ static void fscrypt_destroy(void)
 	list_for_each_entry_safe(pos, n, &fscrypt_free_ctxs, free_list)
 		kmem_cache_free(fscrypt_ctx_cachep, pos);
 	INIT_LIST_HEAD(&fscrypt_free_ctxs);
-	if (fscrypt_bounce_page_pool)
-		mempool_destroy(fscrypt_bounce_page_pool);
+	mempool_destroy(fscrypt_bounce_page_pool);
 	fscrypt_bounce_page_pool = NULL;
 }

@@ -500,9 +499,7 @@ void __exit fscrypt_exit(void)

 	if (fscrypt_read_workqueue)
 		destroy_workqueue(fscrypt_read_workqueue);
-	if (fscrypt_ctx_cachep)
-		kmem_cache_destroy(fscrypt_ctx_cachep);
-	if (fscrypt_info_cachep)
-		kmem_cache_destroy(fscrypt_info_cachep);
+	kmem_cache_destroy(fscrypt_ctx_cachep);
+	kmem_cache_destroy(fscrypt_info_cachep);
 }
 module_exit(fscrypt_exit);

                 reply	other threads:[~2016-02-17 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1602170831430.2685@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=ildarm@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@google.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®