From: Joseph Qi Date: Fri, 4 Sep 2015 22:44:54 +0000 (-0700) Subject: ocfs2: clean up redundant NULL checks before kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=46359295a352e01a5a017297c70b7ee0c5da6de6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ocfs2: clean up redundant NULL checks before kfree NULL check before kfree is redundant and so clean them up. Signed-off-by: Joseph Qi Reviewed-by: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index b20706e8a4d1..86181d6526dc 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -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); diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 0456ae399bf7..d83d2602cf2b 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -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)