[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.7 1/1] s390x/pci: fix null pointer bug
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH for-2.7 1/1] s390x/pci: fix null pointer bug |
Date: |
Fri, 5 Aug 2016 16:02:41 +0200 |
From: Yi Min Zhao <address@hidden>
We should make sure that it's not NULL firstly.
Signed-off-by: Yi Min Zhao <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-pci-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.9.2