fork.c: fix NULL pointer dereference when nr_threads == threads-max
Changes
1 files changed · +1 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/fork.c | modified | +1 | −0 | View file |
kernel/fork.c
View filediff --git a/kernel/fork.c b/kernel/fork.c
index 242a706..6d5dbb7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1005,6 +1005,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
* triggers too late. This doesn't hurt, the check is only there
* to stop root fork bombs.
*/
+ retval = -EAGAIN;
if (nr_threads >= max_threads)
goto bad_fork_cleanup_count;