2018-08-31 09:29:32

by Ding Xiang

[permalink] [raw]
Subject: [PATCH] ocfs2: Fix unneeded null check

null check for kfree is unnecessary, so remove it.

Signed-off-by: Ding Xiang <[email protected]>w
---
fs/ocfs2/aops.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 302cd7c..da578ad 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1392,8 +1392,7 @@ static int ocfs2_unwritten_check(struct inode *inode,
unlock:
spin_unlock(&oi->ip_lock);
out:
- if (new)
- kfree(new);
+ kfree(new);
return ret;
}

--
1.9.1