]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix MinGW pipeline after 49cb59778a4e6c2d04bb9383a9d97fbbc83f9fce
authorErik Skultety <eskultet@redhat.com>
Fri, 8 Jan 2021 10:33:44 +0000 (11:33 +0100)
committerErik Skultety <eskultet@redhat.com>
Fri, 8 Jan 2021 11:17:13 +0000 (12:17 +0100)
Broken build job: https://gitlab.com/libvirt/libvirt/-/jobs/951162206

Signed-off-by: Erik Skultety <eskultet@redhat.com>
src/util/virmdev.c

index fc27e9e45d9d24d48a13f1a49b22475e89ebebd1..46db6249de87a9d001122c698917170cc1840c47 100644 (file)
@@ -354,7 +354,12 @@ virMediatedDevicePtr
 virMediatedDeviceListSteal(virMediatedDeviceListPtr list,
                            virMediatedDevicePtr dev)
 {
-    int idx = virMediatedDeviceListFindIndex(list, dev->path);
+    int idx = -1;
+
+    if (!dev)
+        return NULL;
+
+    idx = virMediatedDeviceListFindIndex(list, dev->path);
 
     return virMediatedDeviceListStealIndex(list, idx);
 }