diff options
author | Vitaliy Ivanov <vitalivanov@gmail.com> | 2011-07-26 02:12:49 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 05:57:12 +0200 |
commit | fbee8d933c775cdb9daac3063659cda38c1776c2 (patch) | |
tree | 22027a33c69747445c77cc39d1445420067f16b3 /arch/um | |
parent | um: reinstate kernel version in generated .config (diff) | |
download | linux-fbee8d933c775cdb9daac3063659cda38c1776c2.tar.xz linux-fbee8d933c775cdb9daac3063659cda38c1776c2.zip |
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>
Diffstat (limited to 'arch/um')
-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); |