]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix load_elf_binary error path on unshare_files error
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Apr 2004 05:05:40 +0000 (22:05 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 19 Apr 2004 05:05:40 +0000 (22:05 -0700)
From: Chris Wright <chrisw@osdl.org>

Make sure to return proper retval on unshare_files() error in load_elf_binary.

Error noted by Kirill Korotaev <kirillx@7ka.mipt.ru>.

fs/binfmt_elf.c

index d4e59def9709796871cab3899dcfb4bc3b19b13e..a67e6f5864ac3098296d590e7e959998d40e38f5 100644 (file)
@@ -522,7 +522,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                goto out_free_ph;
 
        files = current->files;         /* Refcounted so ok */
-       if(unshare_files() < 0)
+       retval = unshare_files();
+       if (retval < 0)
                goto out_free_ph;
        if (files == current->files) {
                put_files_struct(files);