Loading drivers/oprofile/buffer_sync.c +11 −10 Original line number Original line Diff line number Diff line Loading @@ -141,6 +141,13 @@ static struct notifier_block module_load_nb = { .notifier_call = module_load_notify, .notifier_call = module_load_notify, }; }; static void free_all_tasks(void) { /* make sure we don't leak task structs */ process_task_mortuary(); process_task_mortuary(); } int sync_start(void) int sync_start(void) { { int err; int err; Loading @@ -148,8 +155,6 @@ int sync_start(void) if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL)) if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL)) return -ENOMEM; return -ENOMEM; mutex_lock(&buffer_mutex); err = task_handoff_register(&task_free_nb); err = task_handoff_register(&task_free_nb); if (err) if (err) goto out1; goto out1; Loading @@ -166,7 +171,6 @@ int sync_start(void) start_cpu_work(); start_cpu_work(); out: out: mutex_unlock(&buffer_mutex); return err; return err; out4: out4: profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); Loading @@ -174,6 +178,7 @@ int sync_start(void) profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); out2: out2: task_handoff_unregister(&task_free_nb); task_handoff_unregister(&task_free_nb); free_all_tasks(); out1: out1: free_cpumask_var(marked_cpus); free_cpumask_var(marked_cpus); goto out; goto out; Loading @@ -182,20 +187,16 @@ int sync_start(void) void sync_stop(void) void sync_stop(void) { { /* flush buffers */ mutex_lock(&buffer_mutex); end_cpu_work(); end_cpu_work(); unregister_module_notifier(&module_load_nb); unregister_module_notifier(&module_load_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); task_handoff_unregister(&task_free_nb); task_handoff_unregister(&task_free_nb); mutex_unlock(&buffer_mutex); barrier(); /* do all of the above first */ flush_cpu_work(); /* make sure we don't leak task structs */ flush_cpu_work(); process_task_mortuary(); process_task_mortuary(); free_all_tasks(); free_cpumask_var(marked_cpus); free_cpumask_var(marked_cpus); } } Loading fs/dcookies.c +3 −0 Original line number Original line Diff line number Diff line Loading @@ -178,6 +178,8 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) /* FIXME: (deleted) ? */ /* FIXME: (deleted) ? */ path = d_path(&dcs->path, kbuf, PAGE_SIZE); path = d_path(&dcs->path, kbuf, PAGE_SIZE); mutex_unlock(&dcookie_mutex); if (IS_ERR(path)) { if (IS_ERR(path)) { err = PTR_ERR(path); err = PTR_ERR(path); goto out_free; goto out_free; Loading @@ -194,6 +196,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) out_free: out_free: kfree(kbuf); kfree(kbuf); return err; out: out: mutex_unlock(&dcookie_mutex); mutex_unlock(&dcookie_mutex); return err; return err; Loading Loading
drivers/oprofile/buffer_sync.c +11 −10 Original line number Original line Diff line number Diff line Loading @@ -141,6 +141,13 @@ static struct notifier_block module_load_nb = { .notifier_call = module_load_notify, .notifier_call = module_load_notify, }; }; static void free_all_tasks(void) { /* make sure we don't leak task structs */ process_task_mortuary(); process_task_mortuary(); } int sync_start(void) int sync_start(void) { { int err; int err; Loading @@ -148,8 +155,6 @@ int sync_start(void) if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL)) if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL)) return -ENOMEM; return -ENOMEM; mutex_lock(&buffer_mutex); err = task_handoff_register(&task_free_nb); err = task_handoff_register(&task_free_nb); if (err) if (err) goto out1; goto out1; Loading @@ -166,7 +171,6 @@ int sync_start(void) start_cpu_work(); start_cpu_work(); out: out: mutex_unlock(&buffer_mutex); return err; return err; out4: out4: profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); Loading @@ -174,6 +178,7 @@ int sync_start(void) profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); out2: out2: task_handoff_unregister(&task_free_nb); task_handoff_unregister(&task_free_nb); free_all_tasks(); out1: out1: free_cpumask_var(marked_cpus); free_cpumask_var(marked_cpus); goto out; goto out; Loading @@ -182,20 +187,16 @@ int sync_start(void) void sync_stop(void) void sync_stop(void) { { /* flush buffers */ mutex_lock(&buffer_mutex); end_cpu_work(); end_cpu_work(); unregister_module_notifier(&module_load_nb); unregister_module_notifier(&module_load_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_MUNMAP, &munmap_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); task_handoff_unregister(&task_free_nb); task_handoff_unregister(&task_free_nb); mutex_unlock(&buffer_mutex); barrier(); /* do all of the above first */ flush_cpu_work(); /* make sure we don't leak task structs */ flush_cpu_work(); process_task_mortuary(); process_task_mortuary(); free_all_tasks(); free_cpumask_var(marked_cpus); free_cpumask_var(marked_cpus); } } Loading
fs/dcookies.c +3 −0 Original line number Original line Diff line number Diff line Loading @@ -178,6 +178,8 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) /* FIXME: (deleted) ? */ /* FIXME: (deleted) ? */ path = d_path(&dcs->path, kbuf, PAGE_SIZE); path = d_path(&dcs->path, kbuf, PAGE_SIZE); mutex_unlock(&dcookie_mutex); if (IS_ERR(path)) { if (IS_ERR(path)) { err = PTR_ERR(path); err = PTR_ERR(path); goto out_free; goto out_free; Loading @@ -194,6 +196,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) out_free: out_free: kfree(kbuf); kfree(kbuf); return err; out: out: mutex_unlock(&dcookie_mutex); mutex_unlock(&dcookie_mutex); return err; return err; Loading