um: finally kill ->init_str leaks
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 10 Sep 2011 00:08:48 +0000 (20:08 -0400)
committerRichard Weinberger <richard@nod.at>
Sat, 24 Mar 2012 23:29:54 +0000 (00:29 +0100)
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

index 002d4a968ae64cc5da1866ab9fc0c4b91b8b1b20..9ffade87a8cfd9d25db65727ce646d43289ea67b 100644 (file)
@@ -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);