Commit fbee8d93 authored by Vitaliy Ivanov's avatar Vitaliy Ivanov Committed by Linus Torvalds

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: default avatarVitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7fa38e7e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment