提交 b37d40d1 编写于 作者: D David S. Miller

[SPARC64]: Fix leak when DR added cpu does not bootup.

Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b53bcb67
...@@ -90,7 +90,6 @@ static volatile unsigned long callin_flag = 0; ...@@ -90,7 +90,6 @@ static volatile unsigned long callin_flag = 0;
void __devinit smp_callin(void) void __devinit smp_callin(void)
{ {
int cpuid = hard_smp_processor_id(); int cpuid = hard_smp_processor_id();
struct trap_per_cpu *tb = &trap_block[cpuid];;
__local_per_cpu_offset = __per_cpu_offset(cpuid); __local_per_cpu_offset = __per_cpu_offset(cpuid);
...@@ -119,11 +118,6 @@ void __devinit smp_callin(void) ...@@ -119,11 +118,6 @@ void __devinit smp_callin(void)
atomic_inc(&init_mm.mm_count); atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm; current->active_mm = &init_mm;
if (tb->hdesc) {
kfree(tb->hdesc);
tb->hdesc = NULL;
}
while (!cpu_isset(cpuid, smp_commenced_mask)) while (!cpu_isset(cpuid, smp_commenced_mask))
rmb(); rmb();
...@@ -345,6 +339,7 @@ static struct thread_info *cpu_new_thread = NULL; ...@@ -345,6 +339,7 @@ static struct thread_info *cpu_new_thread = NULL;
static int __devinit smp_boot_one_cpu(unsigned int cpu) static int __devinit smp_boot_one_cpu(unsigned int cpu)
{ {
struct trap_per_cpu *tb = &trap_block[cpu];
unsigned long entry = unsigned long entry =
(unsigned long)(&sparc64_cpu_startup); (unsigned long)(&sparc64_cpu_startup);
unsigned long cookie = unsigned long cookie =
...@@ -389,6 +384,11 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu) ...@@ -389,6 +384,11 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
} }
cpu_new_thread = NULL; cpu_new_thread = NULL;
if (tb->hdesc) {
kfree(tb->hdesc);
tb->hdesc = NULL;
}
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册