Skip to content

Commit

Permalink
ecryptfs: drop null test before destroy functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Tyler Hicks committed Jun 20, 2016
1 parent 33688ab commit c39341c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ecryptfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,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));
}
}

Expand Down

0 comments on commit c39341c

Please sign in to comment.