Skip to content

Commit de7b180

Browse files
author
Markus Armbruster
committed
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: c4583c8 (xen-bus: reduce scope of backend watch) Signed-off-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]> Reviewed-by: Stefano Stabellini <[email protected]>
1 parent 1dd24cc commit de7b180

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hw/xen/xen-bus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ static void xen_bus_realize(BusState *bus, Error **errp)
357357
error_reportf_err(local_err,
358358
"failed to set up '%s' enumeration watch: ",
359359
type[i]);
360+
local_err = NULL;
360361
}
361362

362363
g_free(node);

0 commit comments

Comments
 (0)