summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/fork.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 3ba556b47705..2d13c18afe25 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -129,6 +129,7 @@ static int get_pid(unsigned long flags)
{
static int next_safe = PID_MAX;
struct task_struct *p;
+ int pid;
if (flags & CLONE_PID)
return current->pid;
@@ -164,9 +165,10 @@ inside:
}
read_unlock(&tasklist_lock);
}
+ pid = last_pid;
spin_unlock(&lastpid_lock);
- return last_pid;
+ return pid;
}
static inline int dup_mmap(struct mm_struct * mm)