Skip to content

Commit

Permalink
uml: drivers/slip_user.c memory leak fix
Browse files Browse the repository at this point in the history
Do not free memory when you failed to allocate it.

Signed-off-by: Vitaliy Ivanov <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
vitalivanov authored and torvalds committed Jul 26, 2011
1 parent 2fdf213 commit 9a8beb9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/um/drivers/slip_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int slip_tramp(char **argv, int fd)
"buffer\n");
os_kill_process(pid, 1);
err = -ENOMEM;
goto out_free;
goto out_close;
}

close(fds[1]);
Expand All @@ -112,7 +112,6 @@ static int slip_tramp(char **argv, int fd)
err = helper_wait(pid);
close(fds[0]);

out_free:
kfree(output);
return err;

Expand Down

0 comments on commit 9a8beb9

Please sign in to comment.