On Mon, Mar 17, 2014 at 03:22:11PM +0100, Pavel Hrdina wrote:
Coverity found an issue in lxc_driver and uml_driver that we
don't
check the return value of register functions.
I've also updated all other places and unify the way we check the
return value.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 955465a..c9711bb 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -7825,15 +7825,23 @@ remoteRegister(void)
{
remoteDriver = &remote_driver;
- if (virRegisterDriver(&remote_driver) == -1) return -1;
- if (virRegisterNetworkDriver(&network_driver) == -1) return -1;
- if (virRegisterInterfaceDriver(&interface_driver) == -1) return -1;
- if (virRegisterStorageDriver(&storage_driver) == -1) return -1;
- if (virRegisterNodeDeviceDriver(&node_device_driver) == -1) return -1;
- if (virRegisterSecretDriver(&secret_driver) == -1) return -1;
- if (virRegisterNWFilterDriver(&nwfilter_driver) == -1) return -1;
+ if (virRegisterDriver(&remote_driver) < 0)
+ return -1;
+ if (virRegisterNetworkDriver(&network_driver) < 0)
+ return -1;
+ if (virRegisterInterfaceDriver(&interface_driver) < 0)
+ return -1;
+ if (virRegisterStorageDriver(&storage_driver) < 0)
+ return -1;
+ if (virRegisterNodeDeviceDriver(&node_device_driver) < 0)
+ return -1;
+ if (virRegisterSecretDriver(&secret_driver) < 0)
+ return -1;
+ if (virRegisterNWFilterDriver(&nwfilter_driver) < 0)
+ return -1;
#ifdef WITH_LIBVIRTD
- if (virRegisterStateDriver(&state_driver) == -1) return -1;
+ if (virRegisterStateDriver(&state_driver) == -1) < 0)
+ return -1;
#endif
Opps, I missed that you left in the '== -1)' bit here
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|