[libvirt PATCH] Fix MinGW pipeline after 49cb59778a4e6c2d04bb9383a9d97fbbc83f9fce

Erik Skultety posted 1 patch 1 week, 6 days ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/0ece9e32911952ad6c44fc85331ca64c37450478.1610104429.git.eskultet@redhat.com
src/util/virmdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

[libvirt PATCH] Fix MinGW pipeline after 49cb59778a4e6c2d04bb9383a9d97fbbc83f9fce

Posted by Erik Skultety 1 week, 6 days ago
Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
personal pipeline: https://gitlab.com/eskultety/libvirt/-/pipelines/239002989

Pushed under the build breaker rule.


 src/util/virmdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index fc27e9e45d..46db6249de 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -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);
 }
-- 
2.29.2

Re: [libvirt PATCH] Fix MinGW pipeline after 49cb59778a4e6c2d04bb9383a9d97fbbc83f9fce

Posted by Peter Krempa 1 week, 6 days ago
On Fri, Jan 08, 2021 at 12:15:04 +0100, Erik Skultety wrote:

Please always describe what you are fixing. The commit message including
summary doesn't shed any light what the problem was. Even if it was
false positive.

Also I'm pretty sure this breaks migw builds even outside of our CI.

> Signed-off-by: Erik Skultety <eskultet@redhat.com>
> ---
> personal pipeline: https://gitlab.com/eskultety/libvirt/-/pipelines/239002989
> 
> Pushed under the build breaker rule.