diff options
author | Vitaliy Ivanov <vitalivanov@gmail.com> | 2011-07-25 17:12:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 20:57:12 -0700 |
commit | fbee8d933c775cdb9daac3063659cda38c1776c2 (patch) | |
tree | 22027a33c69747445c77cc39d1445420067f16b3 | |
parent | 7fa38e7e9ead2dc7a346db10dd27a40dd83b2a26 (diff) |
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.c | 5 |
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); |