In commit
0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae the call to
platform_driver_unregister() was made conditional upon !HOTPLUG_CPU,
but the return value from coretemp_init() was left to indicate an
error. This isn't correct, as the negative return value indicates to
the module loader that initialization failed, which isn't intended
here and results in dangling pointers.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Chen Gong <gong.chen@linux.intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
" has no thermal sensor.\n", c->x86_model);
}
}
" has no thermal sensor.\n", c->x86_model);
}
}
+
+#ifndef CONFIG_HOTPLUG_CPU
if (list_empty(&pdev_list)) {
err = -ENODEV;
goto exit_driver_unreg;
}
if (list_empty(&pdev_list)) {
err = -ENODEV;
goto exit_driver_unreg;
}
register_hotcpu_notifier(&coretemp_cpu_notifier);
return 0;
register_hotcpu_notifier(&coretemp_cpu_notifier);
return 0;
#ifndef CONFIG_HOTPLUG_CPU
#ifndef CONFIG_HOTPLUG_CPU
platform_driver_unregister(&coretemp_driver);
#endif
exit:
platform_driver_unregister(&coretemp_driver);
#endif
exit: