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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user