Skip to contentSkip to conversation

ocfs2/dlm: Remove redundant null pointer check

PATCH New Sachin Kamat 3 participants 3 messages Apr 26, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2/dlm: Remove redundant null pointer check

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

---
 fs/ocfs2/dlm/dlmrecovery.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ocfs2/dlm/dlmrecovery.c +2 -4
index ba1e689..5f9e476 100644
@@ -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);
 	}
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 ocfs2/dlm: Remove redundant null pointer check

Quoted 10 lines · On Fri, 26 Apr 2013 10:51:59 -0700 Mark Fasheh <[email protected]> wrote:

This seems entirely reasonable.

Quoted 4 lines · Sachin Kamat

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

	--Mark

For some reason I didn't receive the original email. Resend, please?