aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-08 18:11:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-08 18:11:17 -0500
commit29bb5d4fd3140a7d5d02d858118c74a45f15c296 (patch)
treebed72baeafecb0e33e816709c432595804dc711d /drivers/base/cpu.c
parent15f51136719699d7204eeeccd66849a4d90ae426 (diff)
driver-core: cpu: fix kobject warning when hotplugging a cpu
Due to the sysdev conversion to struct device, the cpu objects get reused when adding a cpu after offlining it, which causes a big warning that the kobject portion is not properly initialized. So clear out the object before we register it again, so all is quiet. Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 23f2c4cd48d1..4dabf5077c48 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -240,6 +240,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
240 int error; 240 int error;
241 241
242 cpu->node_id = cpu_to_node(num); 242 cpu->node_id = cpu_to_node(num);
243 memset(&cpu->dev, 0x00, sizeof(struct device));
243 cpu->dev.id = num; 244 cpu->dev.id = num;
244 cpu->dev.bus = &cpu_subsys; 245 cpu->dev.bus = &cpu_subsys;
245 cpu->dev.release = cpu_device_release; 246 cpu->dev.release = cpu_device_release;