Message ID | 20181008173125.19678-16-armbru@redhat.com |
---|---|
State | New |
Headers | show |
Series | Replace some unwise uses of error_report() & friends | expand |
On Mon, Oct 08, 2018 at 07:31:09PM +0200, Markus Armbruster wrote: > The conversion of "xen-pci-passthrough" to realize() (commit > 5a11d0f7549, v2.6.0) neglected to convert the xen_pt_config_init() > error path. If xen_pt_config_init() fails, xen_pt_realize() reports > the error, then returns success without completing its job. I don't > know the exact impact, but it can't be good. > > Belatedly convert the error path. > > Fixes: 5a11d0f7549e24a10e178a9dc8ff5e698031d9a6 > Cc: Stefano Stabellini <sstabellini@kernel.org> > Cc: Anthony Perard <anthony.perard@citrix.com> > Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Thanks,
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index e5a6eff44f..f1f3a3727c 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -830,7 +830,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp) xen_pt_config_init(s, &err); if (err) { error_append_hint(&err, "PCI Config space initialisation failed"); - error_report_err(err); + error_propagate(errp, err); rc = -1; goto err_out; }
The conversion of "xen-pci-passthrough" to realize() (commit 5a11d0f7549, v2.6.0) neglected to convert the xen_pt_config_init() error path. If xen_pt_config_init() fails, xen_pt_realize() reports the error, then returns success without completing its job. I don't know the exact impact, but it can't be good. Belatedly convert the error path. Fixes: 5a11d0f7549e24a10e178a9dc8ff5e698031d9a6 Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Anthony Perard <anthony.perard@citrix.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> --- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)