ocfs2: Proper cleanup in case of error in ocfs2_register_hb_callbacks()

If ocfs2_register_hb_callbacks() succeeds on its first callback but fails
its second, it doesn't release the first on the way out. Fix that.

While we're at it, o2hb_unregister_callback() never returns anything but
0, so let's make it void.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
This commit is contained in:
Joel Becker
2007-02-03 03:14:30 -08:00
committed by Mark Fasheh
parent c3442e2965
commit c24f72cc7c
4 changed files with 10 additions and 26 deletions

View File

@@ -1638,17 +1638,8 @@ static void o2net_hb_node_up_cb(struct o2nm_node *node, int node_num,
void o2net_unregister_hb_callbacks(void)
{
int ret;
ret = o2hb_unregister_callback(&o2net_hb_up);
if (ret < 0)
mlog(ML_ERROR, "Status return %d unregistering heartbeat up "
"callback!\n", ret);
ret = o2hb_unregister_callback(&o2net_hb_down);
if (ret < 0)
mlog(ML_ERROR, "Status return %d unregistering heartbeat down "
"callback!\n", ret);
o2hb_unregister_callback(&o2net_hb_up);
o2hb_unregister_callback(&o2net_hb_down);
}
int o2net_register_hb_callbacks(void)