From bb001c61c3c3f5d2eeb49032fa33de6232411a37 Mon Sep 17 00:00:00 2001 From: Silas Boyd-Wickizer Date: Sun, 23 Sep 2012 20:27:32 +0200 Subject: [PATCH] --- yaml --- r: 323133 b: refs/heads/master c: 641f14560035bbb86500ea4b3a27ad27f034725b h: refs/heads/master i: 323131: 1bf5c5f8b0633db268188b29914ebaab6e13f1e4 v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/coretemp.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index cd954f5815ea..443aa1bac4e2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ec3ddfd27a77db55b8c0e80bcd27c656473fb96 +refs/heads/master: 641f14560035bbb86500ea4b3a27ad27f034725b diff --git a/trunk/drivers/hwmon/coretemp.c b/trunk/drivers/hwmon/coretemp.c index 0fa356fe82cc..984a3f13923b 100644 --- a/trunk/drivers/hwmon/coretemp.c +++ b/trunk/drivers/hwmon/coretemp.c @@ -815,17 +815,20 @@ static int __init coretemp_init(void) if (err) goto exit; + get_online_cpus(); for_each_online_cpu(i) get_core_online(i); #ifndef CONFIG_HOTPLUG_CPU if (list_empty(&pdev_list)) { + put_online_cpus(); err = -ENODEV; goto exit_driver_unreg; } #endif register_hotcpu_notifier(&coretemp_cpu_notifier); + put_online_cpus(); return 0; #ifndef CONFIG_HOTPLUG_CPU @@ -840,6 +843,7 @@ static void __exit coretemp_exit(void) { struct pdev_entry *p, *n; + get_online_cpus(); unregister_hotcpu_notifier(&coretemp_cpu_notifier); mutex_lock(&pdev_list_mutex); list_for_each_entry_safe(p, n, &pdev_list, list) { @@ -848,6 +852,7 @@ static void __exit coretemp_exit(void) kfree(p); } mutex_unlock(&pdev_list_mutex); + put_online_cpus(); platform_driver_unregister(&coretemp_driver); }