[PATCH] qemu: don't use initialized ret in qemuRemoveSharedDevice

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

 



This fixes

  CC     qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo
  qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice':
  qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
---
This is only catched by Debian Wheezy's gcc 4.7.2, Jessies gcc 4.9.2 doesn't
trap on it.

 src/qemu/qemu_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 2ab5494..38d4a86 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1381,7 +1381,7 @@ qemuRemoveSharedHostdev(virQEMUDriverPtr driver,
 {
     char *dev_path = NULL;
     char *key = NULL;
-    int ret;
+    int ret = -1;
 
     if (!qemuIsSharedHostdev(hostdev))
         return 0;
-- 
2.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]