]> err.no Git - linux-2.6/blobdiff - fs/ocfs2/cluster/heartbeat.c
usb: musb: pass configuration specifics via pdata
[linux-2.6] / fs / ocfs2 / cluster / heartbeat.c
index 443d108211ab8675915ef751a2c6c2062e96e4bb..7dce1612553e424e5d006ed20aa9d3429284f34c 100644 (file)
@@ -1489,31 +1489,22 @@ static struct o2hb_heartbeat_group *to_o2hb_heartbeat_group(struct config_group
                : NULL;
 }
 
-static int o2hb_heartbeat_group_make_item(struct config_group *group,
-                                         const char *name,
-                                         struct config_item **new_item)
+static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
+                                                         const char *name)
 {
        struct o2hb_region *reg = NULL;
-       int ret = 0;
 
        reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
-       if (reg == NULL) {
-               ret = -ENOMEM;
-               goto out;
-       }
+       if (reg == NULL)
+               return ERR_PTR(-ENOMEM);
 
        config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
 
-       *new_item = &reg->hr_item;
-
        spin_lock(&o2hb_live_lock);
        list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
        spin_unlock(&o2hb_live_lock);
-out:
-       if (ret)
-               kfree(reg);
 
-       return ret;
+       return &reg->hr_item;
 }
 
 static void o2hb_heartbeat_group_drop_item(struct config_group *group,