aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>2016-08-05 17:00:35 +0800
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-08-08 12:47:02 +0200
commit7fc0abf4cb740609e802611690a3cdb7ff5f21bd (patch)
tree9d4e26dc33f7b0adf47a4d2406f5c6074c1bf059 /hw/s390x
parent51009170d8fc263cfdcd5a60fe3ba213daa3d15b (diff)
downloadqemu-7fc0abf4cb740609e802611690a3cdb7ff5f21bd.zip
qemu-7fc0abf4cb740609e802611690a3cdb7ff5f21bd.tar.gz
qemu-7fc0abf4cb740609e802611690a3cdb7ff5f21bd.tar.bz2
s390x/pci: fix null pointer bug
We should make sure that it's not NULL firstly. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/s390-pci-bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 47ca853..9c1c04e 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -712,7 +712,7 @@ static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev,
pci_dev = PCI_DEVICE(dev);
for (i = 0 ; i < PCI_SLOT_MAX; i++) {
- if (s->pbdev[i]->pdev == pci_dev) {
+ if (s->pbdev[i] && s->pbdev[i]->pdev == pci_dev) {
pbdev = s->pbdev[i];
break;
}