[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1602170831430.2685@hadrien>
Date: Wed, 17 Feb 2016 08:32:56 -0500 (EST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Jaegeuk Kim <jaegeuk@...nel.org>
cc: kbuild-all@...org, Theodore Ts'o <tytso@....edu>,
Michael Halcrow <mhalcrow@...gle.com>,
Ildar Muslukhov <ildarm@...gle.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] fs crypto: fix ifnullfree.cocci warnings
NULL check before some freeing functions is not needed.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...6.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);
Powered by blists - more mailing lists