All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] x86/hwmon: fix module init for
@ 2010-09-13 10:05 ` Jan Beulich
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Beulich @ 2010-09-13 10:05 UTC (permalink / raw)
  To: fenghua.yu, khali; +Cc: gong.chen, lm-sensors, linux-kernel

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>

---
 drivers/hwmon/coretemp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- linux-2.6.36-rc4/drivers/hwmon/coretemp.c	2010-09-13 08:45:02.000000000 +0200
+++ 2.6.36-rc4-x86-coretemp-hotplug-init-return/drivers/hwmon/coretemp.c	2010-09-03 17:54:14.000000000 +0200
@@ -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:




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-09-24 18:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 10:05 [lm-sensors] [PATCH] x86/hwmon: fix module init for Jan Beulich
2010-09-13 10:05 ` [PATCH] x86/hwmon: fix module init for hotplug-but-no-device-found case Jan Beulich
2010-09-14  6:30 ` [lm-sensors] [PATCH] x86/hwmon: fix module init Chen Gong
2010-09-14  6:30   ` [lm-sensors] [PATCH] x86/hwmon: fix module init for hotplug-but-no-device-found case Chen Gong
2010-09-14  6:47   ` [lm-sensors] [PATCH] x86/hwmon: fix module init Jan Beulich
2010-09-14  6:47     ` [lm-sensors] [PATCH] x86/hwmon: fix module init for hotplug-but-no-device-found case Jan Beulich
2010-09-14  7:46     ` [lm-sensors] [PATCH] x86/hwmon: fix module Chen Gong
2010-09-14  7:46       ` [lm-sensors] [PATCH] x86/hwmon: fix module init for hotplug-but-no-device-found case Chen Gong
2010-09-14  8:19       ` [lm-sensors] [PATCH] x86/hwmon: fix module init for Jan Beulich
2010-09-14  8:19         ` [lm-sensors] [PATCH] x86/hwmon: fix module init for hotplug-but-no-device-found case Jan Beulich
2010-09-24  4:43 ` Guenter Roeck
2010-09-24 18:50 ` [lm-sensors] x86/hwmon: fix module init for Guenter Roeck
2010-09-24 18:50   ` x86/hwmon: fix module init for hotplug-but-no-device-found case Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.