uml: drivers/slip_user.c memory leak fix
authorVitaliy Ivanov <vitalivanov@gmail.com>
Tue, 26 Jul 2011 00:12:51 +0000 (17:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 03:57:13 +0000 (20:57 -0700)
Do not free memory when you failed to allocate it.

Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/slip_user.c

index a1c2d2c98a942b9798994444f00501ddd5678132..cbacfc4e63e674341eded605cd508b2b61f06792 100644 (file)
@@ -102,7 +102,7 @@ static int slip_tramp(char **argv, int fd)
                       "buffer\n");
                os_kill_process(pid, 1);
                err = -ENOMEM;
-               goto out_free;
+               goto out_close;
        }
 
        close(fds[1]);
@@ -112,7 +112,6 @@ static int slip_tramp(char **argv, int fd)
        err = helper_wait(pid);
        close(fds[0]);
 
-out_free:
        kfree(output);
        return err;