xen: Fix and improve handling of device_add usb-host errors
commit56f9dde414053410857d0083e92e5b1b45cf33dc
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2020 10:19:00 +0000 (5 12:19 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 27 May 2020 05:45:17 +0000 (27 07:45 +0200)
tree06f3413646825967709f76916da46878ead6f978
parent75de4efa00d2e3df5abfd6b35fc5b04e98443dd2
xen: Fix and improve handling of device_add usb-host errors

usbback_portid_add() leaks the error when qdev_device_add() fails.
Fix that.  While there, use the error to improve the error message.

The qemu_opts_from_qdict() similarly leaks on failure.  But any
failure there is a programming error.  Pass &error_abort.

Fixes: 816ac92ef769f9ffc534e49a1bb6177bddce7aa2
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Paul Durrant <paul@xen.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-3-armbru@redhat.com>
Acked-by: Paul Durrant <paul@xen.org>
hw/usb/xen-usb.c