]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] OProfile: flush work queue on shutdown
authorJohn Levon <levon@movementarian.org>
Sun, 25 May 2003 14:42:27 +0000 (07:42 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 25 May 2003 14:42:27 +0000 (07:42 -0700)
My previous fix was incomplete, we could get the same thing happening
on the init-failure path. Fix that.

drivers/oprofile/buffer_sync.c

index a566ba9f6e36825dbd66bf12454bbc0a716df150..a5bcb23929e6fadf3e323174ab74fc4478b4d949 100644 (file)
@@ -127,6 +127,14 @@ static struct notifier_block module_load_nb = {
 };
 
  
+static void end_sync_timer(void)
+{
+       del_timer_sync(&sync_timer);
+       /* timer might have queued work, make sure it's completed. */
+       flush_scheduled_work();
+}
+
+
 int sync_start(void)
 {
        int err;
@@ -158,7 +166,7 @@ out3:
 out2:
        profile_event_unregister(EXIT_TASK, &exit_task_nb);
 out1:
-       del_timer_sync(&sync_timer);
+       end_sync_timer();
        goto out;
 }
 
@@ -169,9 +177,7 @@ void sync_stop(void)
        profile_event_unregister(EXIT_TASK, &exit_task_nb);
        profile_event_unregister(EXIT_MMAP, &exit_mmap_nb);
        profile_event_unregister(EXEC_UNMAP, &exec_unmap_nb);
-       del_timer_sync(&sync_timer);
-       /* timer might have queued work, make sure it's completed. */
-       flush_scheduled_work();
+       end_sync_timer();
 }