From c8e2876fc8adaf9539f051fcda5d551308e8a0f8 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri, 9 Sep 2011 20:08:48 -0400
Subject: um: finally kill ->init_str leaks

now we can do that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/drivers/line.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'arch/um')

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 002d4a968ae..9ffade87a8c 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);
-- 
cgit v1.2.3-70-g09d2