Pull ec into release branch
[pandora-kernel.git] / fs / ocfs2 / heartbeat.c
index 8fc52d6..b25ef63 100644 (file)
@@ -164,8 +164,10 @@ int ocfs2_register_hb_callbacks(struct ocfs2_super *osb)
        }
 
        status = o2hb_register_callback(&osb->osb_hb_up);
-       if (status < 0)
+       if (status < 0) {
                mlog_errno(status);
+               o2hb_unregister_callback(&osb->osb_hb_down);
+       }
 
 bail:
        return status;
@@ -173,18 +175,11 @@ bail:
 
 void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb)
 {
-       int status;
-
        if (ocfs2_mount_local(osb))
                return;
 
-       status = o2hb_unregister_callback(&osb->osb_hb_down);
-       if (status < 0)
-               mlog_errno(status);
-
-       status = o2hb_unregister_callback(&osb->osb_hb_up);
-       if (status < 0)
-               mlog_errno(status);
+       o2hb_unregister_callback(&osb->osb_hb_down);
+       o2hb_unregister_callback(&osb->osb_hb_up);
 }
 
 void ocfs2_stop_heartbeat(struct ocfs2_super *osb)