]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/xen: Fix xen_bus_realize() error handling
authorMarkus Armbruster <armbru@redhat.com>
Fri, 14 Mar 2025 14:34:59 +0000 (15:34 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 19 Mar 2025 08:36:15 +0000 (09:36 +0100)
commitde7b18083bfed4e1a01bb40b4ad050c47d2011fa
tree2c4d2a75c112e1eb78f021413a20df0d4671c265
parent1dd24ccf829db234e23156c68b013e038040bf94
hw/xen: Fix xen_bus_realize() error handling

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

xen_bus_realize() is wrong that way: it passes &local_err to
xs_node_watch() in a loop.  If this fails in more than one iteration,
it can trip error_setv()'s assertion.

Fix by clearing @local_err.

Fixes: c4583c8c394e (xen-bus: reduce scope of backend watch)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250314143500.2449658-2-armbru@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
hw/xen/xen-bus.c