Skip to contentSkip to conversation

ocfs2: remove unneeded 'rc' for kfree()

PATCH New Daeseok Youn 1 participant 1 message Feb 17, 2015 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ocfs2: remove unneeded 'rc' for kfree()

If kzalloc() is failed, just goto 'out' label and 'out_free' label doesn't need to check 'rc' variable.

---
 fs/ocfs2/stack_o2cb.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
fs/ocfs2/stack_o2cb.c +2 -3
index 813d726..46ab104 100644
@@ -347,7 +347,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn)
 	priv = kzalloc(sizeof(struct o2dlm_private), GFP_KERNEL);
 	if (!priv) {
 		rc = -ENOMEM;
-		goto out_free;
+		goto out;
 	}
 
 	/* This just fills the structure in.  It is safe to pass conn. */
@@ -376,8 +376,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn)
 	dlm_register_eviction_cb(dlm, &priv->op_eviction_cb);
 
 out_free:
-	if (rc)
-		kfree(conn->cc_private);
+	kfree(conn->cc_private);
 
 out:
 	return rc;
Signature · 1 line
1.7.1