summaryrefslogtreecommitdiff
path: root/drivers/hwmon/coretemp.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2010-09-13 14:05:51 +0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-09-24 22:44:18 +0400
commit89a3fd35ba0318a7208e2c8d8ca6189f567d4a93 (patch)
treec558ed6e5b37bff0ed2d8d6e7b0ca3832547a21f /drivers/hwmon/coretemp.c
parentf7c77a3dc4683659b6f0d1b6cbc82b6253d095e0 (diff)
downloadlinux-89a3fd35ba0318a7208e2c8d8ca6189f567d4a93.tar.xz
x86/hwmon: fix module init for hotplug-but-no-device-found case
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>
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r--drivers/hwmon/coretemp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index de8111114f46..6b3ef553bd13 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -541,16 +541,19 @@ static int __init coretemp_init(void)
" has no thermal sensor.\n", c->x86_model);
}
}
+
+#ifndef CONFIG_HOTPLUG_CPU
if (list_empty(&pdev_list)) {
err = -ENODEV;
goto exit_driver_unreg;
}
+#endif
register_hotcpu_notifier(&coretemp_cpu_notifier);
return 0;
-exit_driver_unreg:
#ifndef CONFIG_HOTPLUG_CPU
+exit_driver_unreg:
platform_driver_unregister(&coretemp_driver);
#endif
exit: