]> xenbits.xensource.com Git - libvirt.git/commitdiff
openvzRegister: Check for error return
authorJohn Ferlan <jferlan@redhat.com>
Fri, 14 Mar 2014 10:26:40 +0000 (06:26 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 14 Mar 2014 10:40:55 +0000 (06:40 -0400)
A recent change to openvz_driver.c caused Coverity to make additional
comparisons and find that the openvzRegister() was not checking the
status of virRegisterDriver() call like other callers and thus generated
a CHECKED_RETURN condition

src/openvz/openvz_driver.c

index 393f397568120fe3d436b85aef3bd5236ce0eaab..c10fa05d49b98b9db4c8b086b129a8d4fce62964 100644 (file)
@@ -2239,6 +2239,7 @@ static virDriver openvzDriver = {
 };
 
 int openvzRegister(void) {
-    virRegisterDriver(&openvzDriver);
+    if (virRegisterDriver(&openvzDriver) < 0)
+        return -1;
     return 0;
 }