Commit 86fd2f2f authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Arnaldo Carvalho de Melo

[PATCH] alpha: fix panic on smp boot (fork_by_hand)

parent 2f50ae4b
...@@ -417,12 +417,7 @@ fork_by_hand(void) ...@@ -417,12 +417,7 @@ fork_by_hand(void)
/* Don't care about the contents of regs since we'll never /* Don't care about the contents of regs since we'll never
reschedule the forked task. */ reschedule the forked task. */
struct pt_regs regs; struct pt_regs regs;
int pid; return copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
pid = do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
if (pid < 0)
return NULL;
return find_task_by_pid (pid);
} }
/* /*
...@@ -441,9 +436,11 @@ smp_boot_one_cpu(int cpuid) ...@@ -441,9 +436,11 @@ smp_boot_one_cpu(int cpuid)
wish. We can't use kernel_thread since we must avoid wish. We can't use kernel_thread since we must avoid
rescheduling the child. */ rescheduling the child. */
idle = fork_by_hand(); idle = fork_by_hand();
if (!idle) if (IS_ERR(idle))
panic("failed fork for CPU %d", cpuid); panic("failed fork for CPU %d", cpuid);
wake_up_forked_process(idle);
init_idle(idle, cpuid); init_idle(idle, cpuid);
unhash_process(idle); unhash_process(idle);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment