summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/line.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 002d4a9..9ffade8 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);
OpenPOWER on IntegriCloud