]> git.proxmox.com Git - mirror_qemu.git/commit
hw/pci: Have safer pcie_bus_realize() by checking error path
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 1 Feb 2021 15:37:00 +0000 (16:37 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 2 Mar 2021 14:16:18 +0000 (09:16 -0500)
commitb52fa0ea45bea494a953dd766151d584a28e87e5
treed71d632dc72a62e8bea172c78dac0bfe23b278de
parentfb592882397870a9eaf206f6c92789274ed07dda
hw/pci: Have safer pcie_bus_realize() by checking error path

While pci_bus_realize() currently does not use the Error* argument,
it would be an error to leave pcie_bus_realize() setting bus->flags
if pci_bus_realize() had failed.

Fix by using a local Error* and return early (propagating the error)
if pci_bus_realize() failed.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210201153700.618946-1-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c