summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorVitaliy Ivanov <vitalivanov@gmail.com>2011-07-25 17:12:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:12 -0700
commitfbee8d933c775cdb9daac3063659cda38c1776c2 (patch)
tree22027a33c69747445c77cc39d1445420067f16b3 /arch/um/drivers
parent7fa38e7e9ead2dc7a346db10dd27a40dd83b2a26 (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>
Diffstat (limited to 'arch/um/drivers')
-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 9415dd9e63e..520118888f1 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);