ocfs2: clean up redundant NULL checks before kfree
authorJoseph Qi <joseph.qi@huawei.com>
Fri, 4 Sep 2015 22:44:54 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Sep 2015 23:54:41 +0000 (16:54 -0700)
NULL check before kfree is redundant and so clean them up.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/alloc.c
fs/ocfs2/suballoc.c

index b20706e8a4d1cd8840deefc32a73ff88275e0eb6..86181d6526dc55de22b8e118660fba86546ae340 100644 (file)
@@ -6178,7 +6178,7 @@ bail:
                iput(tl_inode);
        brelse(tl_bh);
 
-       if (status < 0 && (*tl_copy)) {
+       if (status < 0) {
                kfree(*tl_copy);
                *tl_copy = NULL;
                mlog_errno(status);
index 0456ae399bf71f4fbff6c2e3cb1f0e3aa5e561eb..d83d2602cf2b0aa8c7eee8a83f159ed54ccdb0c1 100644 (file)
@@ -149,10 +149,8 @@ void ocfs2_free_ac_resource(struct ocfs2_alloc_context *ac)
        brelse(ac->ac_bh);
        ac->ac_bh = NULL;
        ac->ac_resv = NULL;
-       if (ac->ac_find_loc_priv) {
-               kfree(ac->ac_find_loc_priv);
-               ac->ac_find_loc_priv = NULL;
-       }
+       kfree(ac->ac_find_loc_priv);
+       ac->ac_find_loc_priv = NULL;
 }
 
 void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac)