summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy Ivanov <vitalivanov@gmail.com>2011-07-26 04:12:49 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 07:57:12 +0400
commitfbee8d933c775cdb9daac3063659cda38c1776c2 (patch)
tree22027a33c69747445c77cc39d1445420067f16b3
parent7fa38e7e9ead2dc7a346db10dd27a40dd83b2a26 (diff)
downloadlinux-fbee8d933c775cdb9daac3063659cda38c1776c2.tar.xz
uml: drivers/net_user.c memory leak fix
Perform memory cleanup on exit. On receiving invalid 'pid' we still should clean 'output' variable. 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/net_user.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 9415dd9e63ef..520118888f16 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -228,7 +228,10 @@ static void change(char *dev, char *what, unsigned char *addr,
"buffer\n");
pid = change_tramp(argv, output, output_len);
- if (pid < 0) return;
+ if (pid < 0) {
+ kfree(output);
+ return;
+ }
if (output != NULL) {
printk("%s", output);