|
@@ -625,6 +625,7 @@ out:
|
|
|
/*
|
|
|
* 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;
|