mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
23aec6005a
commit
8bd6b06d7b
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
qemu_del_timer(active_console->cursor_timer);
|
||||
}
|
||||
active_console = s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue