[Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: Remove redundant null pointer check

Sachin Kamat sachin.kamat at linaro.org
Fri Apr 26 04:00:22 PDT 2013


kfree on a NULL pointer is a no-op. Hence remove the redundant null
pointer check.

Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
---
 fs/ocfs2/dlm/dlmrecovery.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index ba1e689..5f9e476 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -1498,10 +1498,8 @@ leave:
 
 	dlm_put(dlm);
 	if (ret < 0) {
-		if (buf)
-			kfree(buf);
-		if (item)
-			kfree(item);
+		kfree(buf);
+		kfree(item);
 		mlog_errno(ret);
 	}
 
-- 
1.7.9.5




More information about the Ocfs2-devel mailing list