Skip to content

Commit

Permalink
driver-core: cpu: fix kobject warning when hotplugging a cpu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Feb 8, 2012
1 parent 15f5113 commit 29bb5d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
int error;

cpu->node_id = cpu_to_node(num);
memset(&cpu->dev, 0x00, sizeof(struct device));
cpu->dev.id = num;
cpu->dev.bus = &cpu_subsys;
cpu->dev.release = cpu_device_release;
Expand Down

0 comments on commit 29bb5d4

Please sign in to comment.