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