summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>2016-08-10 16:10:08 +0800
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-09-05 15:15:16 +0200
commit0d36d791927753599e9ca36e344f9fb272126e3d (patch)
treedb1a36f7faa0c4d3166a2a366671d6d0cf542c70 /hw
parent61823988df67eba82d59bd9d2cfd643aeac92826 (diff)
downloadqemu-0d36d791927753599e9ca36e344f9fb272126e3d.tar.gz
qemu-0d36d791927753599e9ca36e344f9fb272126e3d.tar.bz2
qemu-0d36d791927753599e9ca36e344f9fb272126e3d.zip
s390x/pci: return directly if create zpci failed
In the case that zpci is automatically created, we did not return immediately on failure, which would lead to NULL pointer dereferencing. Let's fix it. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/s390x/s390-pci-bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 9c1c04e590..5750f22fc3 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -649,6 +649,7 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev,
pbdev = s390_pci_device_new(dev->id);
if (!pbdev) {
error_setg(errp, "create zpci device failed");
+ return;
}
}