]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: ensure min/maj are initialized in virGetDeviceID
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 12 Mar 2020 18:39:35 +0000 (18:39 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 13 Mar 2020 11:28:31 +0000 (11:28 +0000)
The stub impl of virGetDeviceID just returns ENOSYS and does not
initialize the min/maj output parameters. This lead to a false
positive warning on mingw about possible use of uninitialized
variables.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virutil.c

index f77ee05dbf0c0abc860f4d6d9f717faa1ecf601b..ddd88051010445947aa699ba53556433c0585256 100644 (file)
@@ -1407,9 +1407,10 @@ virGetDeviceID(const char *path, int *maj, int *min)
 #else
 int
 virGetDeviceID(const char *path G_GNUC_UNUSED,
-               int *maj G_GNUC_UNUSED,
-               int *min G_GNUC_UNUSED)
+               int *maj,
+               int *min)
 {
+    *maj = *min = 0;
     return -ENOSYS;
 }
 #endif