Merge tag 'locks-v3.15-3' of git://git.samba.org/jlayton/linux
[linux-2.6-microblaze.git] / kernel / profile.c
index 1b266db..cb980f0 100644 (file)
@@ -591,18 +591,28 @@ out_cleanup:
 int __ref create_proc_profile(void) /* false positive from hotcpu_notifier */
 {
        struct proc_dir_entry *entry;
+       int err = 0;
 
        if (!prof_on)
                return 0;
-       if (create_hash_tables())
-               return -ENOMEM;
+
+       cpu_notifier_register_begin();
+
+       if (create_hash_tables()) {
+               err = -ENOMEM;
+               goto out;
+       }
+
        entry = proc_create("profile", S_IWUSR | S_IRUGO,
                            NULL, &proc_profile_operations);
        if (!entry)
-               return 0;
+               goto out;
        proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t));
-       hotcpu_notifier(profile_cpu_callback, 0);
-       return 0;
+       __hotcpu_notifier(profile_cpu_callback, 0);
+
+out:
+       cpu_notifier_register_done();
+       return err;
 }
 subsys_initcall(create_proc_profile);
 #endif /* CONFIG_PROC_FS */