]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ecryptfs: drop null test before destroy functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 13 Sep 2015 12:15:21 +0000 (14:15 +0200)
committerTyler Hicks <tyhicks@canonical.com>
Tue, 15 Sep 2015 14:44:44 +0000 (09:44 -0500)
Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/main.c

index 4f4d0474bee961e456d015a08f5891b686b9033c..e83f31cfd96c90338fae9c60d039f66515def1dc 100644 (file)
@@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
                struct ecryptfs_cache_info *info;
 
                info = &ecryptfs_cache_infos[i];
-               if (*(info->cache))
-                       kmem_cache_destroy(*(info->cache));
+               kmem_cache_destroy(*(info->cache));
        }
 }