From: lichun Date: Fri, 6 Nov 2020 17:03:39 +0000 (+0800) Subject: console: avoid passing con=NULL to graphic_hw_update_done() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1cd8b9487025966123287e532636f231b46e8398;p=qemu.git console: avoid passing con=NULL to graphic_hw_update_done() In graphic_hw_update(), first select an existing console, a specific-console or active_console(if not specified), then updating the console. Signed-off-by: lichun Message-id: 1604682219-114389-1-git-send-email-lichun@ruijie.com.cn Signed-off-by: Gerd Hoffmann --- diff --git a/ui/console.c b/ui/console.c index e8e59707d3..e07d2c380d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -270,10 +270,11 @@ void graphic_hw_update_done(QemuConsole *con) void graphic_hw_update(QemuConsole *con) { bool async = false; + con = con ? con : active_console; if (!con) { - con = active_console; + return; } - if (con && con->hw_ops->gfx_update) { + if (con->hw_ops->gfx_update) { con->hw_ops->gfx_update(con->hw); async = con->hw_ops->gfx_update_async; }