Commit b7753fc7 authored by Kees Cook's avatar Kees Cook

pstore: Make sure console capturing will restart

The CON_ENABLED flag gets cleared during unregister_console(), so make
sure we already reset the console flags before calling register_console(),
otherwise unloading and reloading a pstore backend will not restart
console logging.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 609e28bb
...@@ -516,12 +516,16 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) ...@@ -516,12 +516,16 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
static struct console pstore_console = { static struct console pstore_console = {
.name = "pstore", .name = "pstore",
.write = pstore_console_write, .write = pstore_console_write,
.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME,
.index = -1, .index = -1,
}; };
static void pstore_register_console(void) static void pstore_register_console(void)
{ {
/*
* Always initialize flags here since prior unregister_console()
* calls may have changed settings (specifically CON_ENABLED).
*/
pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME;
register_console(&pstore_console); register_console(&pstore_console);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment