qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-2.8 02/38] s390x/pci: return directly if create


From: Cornelia Huck
Subject: [Qemu-devel] [PATCH for-2.8 02/38] s390x/pci: return directly if create zpci failed
Date: Mon, 29 Aug 2016 13:44:54 +0200

From: Yi Min Zhao <address@hidden>

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 <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/s390x/s390-pci-bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 9c1c04e..5750f22 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;
             }
         }
 
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]