aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/heartbeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.c')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 443d108211ab..f02ccb34604d 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1489,28 +1489,25 @@ static struct o2hb_heartbeat_group *to_o2hb_heartbeat_group(struct config_group
1489 : NULL; 1489 : NULL;
1490} 1490}
1491 1491
1492static int o2hb_heartbeat_group_make_item(struct config_group *group, 1492static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
1493 const char *name, 1493 const char *name)
1494 struct config_item **new_item)
1495{ 1494{
1496 struct o2hb_region *reg = NULL; 1495 struct o2hb_region *reg = NULL;
1497 int ret = 0; 1496 struct config_item *ret = NULL;
1498 1497
1499 reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL); 1498 reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
1500 if (reg == NULL) { 1499 if (reg == NULL)
1501 ret = -ENOMEM; 1500 goto out; /* ENOMEM */
1502 goto out;
1503 }
1504 1501
1505 config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type); 1502 config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
1506 1503
1507 *new_item = &reg->hr_item; 1504 ret = &reg->hr_item;
1508 1505
1509 spin_lock(&o2hb_live_lock); 1506 spin_lock(&o2hb_live_lock);
1510 list_add_tail(&reg->hr_all_item, &o2hb_all_regions); 1507 list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
1511 spin_unlock(&o2hb_live_lock); 1508 spin_unlock(&o2hb_live_lock);
1512out: 1509out:
1513 if (ret) 1510 if (ret == NULL)
1514 kfree(reg); 1511 kfree(reg);
1515 1512
1516 return ret; 1513 return ret;