aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaliy Ivanov <vitalivanov@gmail.com>2011-07-25 20:12:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:57:13 -0400
commit9a8beb93067764344523386e0e5388d3fd78add7 (patch)
treed8458ea042a52610a3b1c0f9517f50ecd67c849a
parent2fdf2130926f07881c75e3905ece472c37d7703f (diff)
uml: drivers/slip_user.c memory leak fix
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>
-rw-r--r--arch/um/drivers/slip_user.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
index a1c2d2c98a94..cbacfc4e63e6 100644
--- a/arch/um/drivers/slip_user.c
+++ b/arch/um/drivers/slip_user.c
@@ -102,7 +102,7 @@ static int slip_tramp(char **argv, int fd)
102 "buffer\n"); 102 "buffer\n");
103 os_kill_process(pid, 1); 103 os_kill_process(pid, 1);
104 err = -ENOMEM; 104 err = -ENOMEM;
105 goto out_free; 105 goto out_close;
106 } 106 }
107 107
108 close(fds[1]); 108 close(fds[1]);
@@ -112,7 +112,6 @@ static int slip_tramp(char **argv, int fd)
112 err = helper_wait(pid); 112 err = helper_wait(pid);
113 close(fds[0]); 113 close(fds[0]);
114 114
115out_free:
116 kfree(output); 115 kfree(output);
117 return err; 116 return err;
118 117