aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 4c358bc44c72..6bfaaca6955e 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -43,11 +43,14 @@ static int __ref cpu_subsys_online(struct device *dev)
43 struct cpu *cpu = container_of(dev, struct cpu, dev); 43 struct cpu *cpu = container_of(dev, struct cpu, dev);
44 int cpuid = dev->id; 44 int cpuid = dev->id;
45 int from_nid, to_nid; 45 int from_nid, to_nid;
46 int ret; 46 int ret = -ENODEV;
47 47
48 cpu_hotplug_driver_lock(); 48 cpu_hotplug_driver_lock();
49 49
50 from_nid = cpu_to_node(cpuid); 50 from_nid = cpu_to_node(cpuid);
51 if (from_nid == NUMA_NO_NODE)
52 goto out;
53
51 ret = cpu_up(cpuid); 54 ret = cpu_up(cpuid);
52 /* 55 /*
53 * When hot adding memory to memoryless node and enabling a cpu 56 * When hot adding memory to memoryless node and enabling a cpu
@@ -57,6 +60,7 @@ static int __ref cpu_subsys_online(struct device *dev)
57 if (from_nid != to_nid) 60 if (from_nid != to_nid)
58 change_cpu_under_node(cpu, from_nid, to_nid); 61 change_cpu_under_node(cpu, from_nid, to_nid);
59 62
63 out:
60 cpu_hotplug_driver_unlock(); 64 cpu_hotplug_driver_unlock();
61 return ret; 65 return ret;
62} 66}