mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
i386/tdx: Remove task->watch only when it's valid
In some case (e.g., failed to connect to QGS socket),
tdx_generate_quote_cleanup() is called with task->watch invalid. It
triggers assertion of
qemu-system-x86_64: GLib: g_source_remove: assertion 'tag > 0' failed
Fix it by checking task->watch.
Fixes: 40da501d89 ("i386/tdx: handle TDG.VP.VMCALL<GetQuote>")
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250625035505.2770580-1-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
b6c5b41ba2
commit
50fd57418c
@@ -75,7 +75,9 @@ static void tdx_generate_quote_cleanup(TdxGenerateQuoteTask *task)
|
||||
{
|
||||
timer_del(&task->timer);
|
||||
|
||||
g_source_remove(task->watch);
|
||||
if (task->watch) {
|
||||
g_source_remove(task->watch);
|
||||
}
|
||||
qio_channel_close(QIO_CHANNEL(task->sioc), NULL);
|
||||
object_unref(OBJECT(task->sioc));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user