Commit 8bd6b06d authored by Stefan Weil's avatar Stefan Weil Committed by Anthony Liguori
Browse files

console: Fix warning from clang (and potential crash)

ccc-analyzer reports this warning:

console.c:1090:29: warning: Dereference of null pointer
        if (active_console->cursor_timer) {

Function console_select allows active_console to be NULL,
but would crash when accessing cursor_timer. Fix this.
Reviewed-by: default avatarJan Kiszka <>
Signed-off-by: default avatarStefan Weil <>
Signed-off-by: default avatarAnthony Liguori <>
parent 23aec600
......@@ -1087,7 +1087,7 @@ void console_select(unsigned int index)
if (s) {
DisplayState *ds = s->ds;
if (active_console->cursor_timer) {
if (active_console && active_console->cursor_timer) {
active_console = s;
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