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>
This commit is contained in:
Vitaliy Ivanov 2011-07-25 17:12:49 -07:00 committed by Linus Torvalds
parent 7fa38e7e9e
commit fbee8d933c

View file

@ -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);