Skip to content

Commit

Permalink
uml: drivers/net_user.c memory leak fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vitaliy Ivanov authored and Linus Torvalds committed Jul 26, 2011
1 parent 7fa38e7 commit fbee8d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/um/drivers/net_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fbee8d9

Please sign in to comment.