From: Al Viro Date: Sat, 10 Sep 2011 00:08:48 +0000 (-0400) Subject: um: finally kill ->init_str leaks X-Git-Tag: firefly_0821_release~3680^2~3242^2~23 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c8e2876fc8adaf9539f051fcda5d551308e8a0f8;p=firefly-linux-kernel-4.4.55.git um: finally kill ->init_str leaks now we can do that... Signed-off-by: Al Viro Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 002d4a968ae6..9ffade87a8cf 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -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);