All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set()
@ 2012-02-13 13:50 ` Dan Carpenter
  0 siblings, 0 replies; 15+ messages in thread
From: Dan Carpenter @ 2012-02-13 13:50 UTC (permalink / raw)
  To: ocfs2-devel

If "ret" is NULL, then "hs" is also NULL, so there is no need to free
it.  config_group_init_type_name() can't fail if the name ("heartbeat"
in this case) is less than CONFIGFS_ITEM_NAME_LEN (20) characters long
so we can just remove this error handling code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index f3f2d95..0bca51b 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -2306,20 +2306,14 @@ static struct config_item_type o2hb_heartbeat_group_type = {
 struct config_group *o2hb_alloc_hb_set(void)
 {
 	struct o2hb_heartbeat_group *hs = NULL;
-	struct config_group *ret = NULL;
 
 	hs = kzalloc(sizeof(struct o2hb_heartbeat_group), GFP_KERNEL);
 	if (hs = NULL)
-		goto out;
+		return NULL;
 
 	config_group_init_type_name(&hs->hs_group, "heartbeat",
 				    &o2hb_heartbeat_group_type);
-
-	ret = &hs->hs_group;
-out:
-	if (ret = NULL)
-		kfree(hs);
-	return ret;
+	return &hs->hs_group;
 }
 
 void o2hb_free_hb_set(struct config_group *group)

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-04-17 21:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 13:50 [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set() Dan Carpenter
2012-02-13 13:50 ` [Ocfs2-devel] " Dan Carpenter
2012-02-13 19:39 ` Sunil Mushran
2012-02-13 19:39   ` [Ocfs2-devel] " Sunil Mushran
2012-02-13 20:06   ` Dan Carpenter
2012-02-13 20:08     ` Dan Carpenter
2012-02-13 20:17     ` Sunil Mushran
2012-02-13 20:17       ` [Ocfs2-devel] " Sunil Mushran
2012-04-17 21:13     ` [Ocfs2-devel] Ocfs2 + Quota! Marek Królikowski
2012-02-13 20:04 ` [patch] ocfs2: cleanup error handling in o2hb_alloc_hb_set() Joel Becker
2012-02-13 20:04   ` [Ocfs2-devel] " Joel Becker
2012-02-13 20:27   ` Dan Carpenter
2012-02-13 20:29     ` Dan Carpenter
2012-02-13 20:41     ` Sunil Mushran
2012-02-13 20:41       ` [Ocfs2-devel] " Sunil Mushran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.