Skip to content

Commit

Permalink
um: finally kill ->init_str leaks
Browse files Browse the repository at this point in the history
now we can do that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Al Viro authored and Richard Weinberger committed Mar 24, 2012
1 parent 04292b2 commit c8e2876
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,10 @@ int setup_one_line(struct line *lines, int n, char *init,
*error_out = "Failed to allocate memory";
return -ENOMEM;
}
if (line->valid)
if (line->valid) {
tty_unregister_device(driver, n);
kfree(line->init_str);
}
line->init_str = new;
line->valid = 1;
err = parse_chan_pair(new, line, n, opts, error_out);
Expand Down

0 comments on commit c8e2876

Please sign in to comment.