diff options
Diffstat (limited to 'arch/i386/kernel/process.c')
-rw-r--r-- | arch/i386/kernel/process.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index dad02a960e03..b0a07801d9df 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -328,6 +328,7 @@ extern void kernel_thread_helper(void); | |||
328 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | 328 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) |
329 | { | 329 | { |
330 | struct pt_regs regs; | 330 | struct pt_regs regs; |
331 | int err; | ||
331 | 332 | ||
332 | memset(®s, 0, sizeof(regs)); | 333 | memset(®s, 0, sizeof(regs)); |
333 | 334 | ||
@@ -342,7 +343,10 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
342 | regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; | 343 | regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; |
343 | 344 | ||
344 | /* Ok, create the new process.. */ | 345 | /* Ok, create the new process.. */ |
345 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | 346 | err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); |
347 | if (err == 0) /* terminate kernel stack */ | ||
348 | task_pt_regs(current)->eip = 0; | ||
349 | return err; | ||
346 | } | 350 | } |
347 | EXPORT_SYMBOL(kernel_thread); | 351 | EXPORT_SYMBOL(kernel_thread); |
348 | 352 | ||