From 1ce47239911d42c7e977caeab790eb0aeec22d24 Mon Sep 17 00:00:00 2001 From: Prasanna Meda Date: Fri, 23 Jun 2006 02:05:23 -0700 Subject: [PATCH] --- yaml --- r: 29043 b: refs/heads/master c: 6e6672604773b9bae44d88d38afdf0763c104b1c h: refs/heads/master i: 29041: caf64da28656365e5864355c8526822e5fd2e45c 29039: 451c43b8934d6cc3d821d9ac03e192e87fc167e1 v: v3 --- [refs] | 2 +- trunk/kernel/fork.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a5583d65a55d..41c337f71c51 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 538c5902b81cc384e93ad3834b6d4a0b3fcb2285 +refs/heads/master: 6e6672604773b9bae44d88d38afdf0763c104b1c diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 195958a3a4d6..49adc0e8d47c 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -625,6 +625,7 @@ static struct files_struct *alloc_files(void) /* * Allocate a new files structure and copy contents from the * passed in files structure. + * errorp will be valid only when the returned files_struct is NULL. */ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp) { @@ -633,6 +634,7 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp) int open_files, size, i, expand; struct fdtable *old_fdt, *new_fdt; + *errorp = -ENOMEM; newf = alloc_files(); if (!newf) goto out; @@ -746,7 +748,6 @@ static int copy_files(unsigned long clone_flags, struct task_struct * tsk) * break this. */ tsk->files = NULL; - error = -ENOMEM; newf = dup_fd(oldf, &error); if (!newf) goto out;