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>
此提交包含在:
Joel Becker
2007-02-03 03:14:30 -08:00
提交者 Mark Fasheh
父節點 c3442e2965
當前提交 c24f72cc7c
共有 4 個檔案被更改,包括 10 行新增26 行删除

查看文件

@@ -1682,7 +1682,7 @@ out:
}
EXPORT_SYMBOL_GPL(o2hb_register_callback);
int o2hb_unregister_callback(struct o2hb_callback_func *hc)
void o2hb_unregister_callback(struct o2hb_callback_func *hc)
{
BUG_ON(hc->hc_magic != O2HB_CB_MAGIC);
@@ -1690,15 +1690,13 @@ int o2hb_unregister_callback(struct o2hb_callback_func *hc)
__builtin_return_address(0), hc);
if (list_empty(&hc->hc_item))
return 0;
return;
down_write(&o2hb_callback_sem);
list_del_init(&hc->hc_item);
up_write(&o2hb_callback_sem);
return 0;
}
EXPORT_SYMBOL_GPL(o2hb_unregister_callback);