This patch introduces a new console_cleanup function. This function
frees up the console resources.
Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
}
}
-static void cleanup_domain(struct domain *d)
+static void console_cleanup(struct console *con)
{
- struct console *con = &d->console;
-
- console_close_tty(con);
-
if (con->log_fd != -1) {
close(con->log_fd);
con->log_fd = -1;
free(con->xspath);
con->xspath = NULL;
+}
+
+static void cleanup_domain(struct domain *d)
+{
+ struct console *con = &d->console;
+
+ console_close_tty(con);
+
+ console_cleanup(con);
remove_domain(d);
}