Fix uninitialized 'copy' in unshare_files
authorAl Viro <viro@ZenIV.linux.org.uk>
Sat, 26 Apr 2008 04:25:00 +0000 (05:25 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Apr 2008 16:24:31 +0000 (09:24 -0700)
Arrgghhh...

Sorry about that, I'd been sure I'd folded that one, but it actually got
lost.  Please apply - that breaks execve().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/fork.c

index efb618f..cb46bef 100644 (file)
@@ -1787,7 +1787,7 @@ bad_unshare_out:
 int unshare_files(struct files_struct **displaced)
 {
        struct task_struct *task = current;
-       struct files_struct *copy;
+       struct files_struct *copy = NULL;
        int error;
 
        error = unshare_fd(CLONE_FILES, &copy);