[PATCH] openvzRegister: Check for error return

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

 



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

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/openvz/openvz_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 393f397..c10fa05 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -2239,6 +2239,7 @@ static virDriver openvzDriver = {
 };
 
 int openvzRegister(void) {
-    virRegisterDriver(&openvzDriver);
+    if (virRegisterDriver(&openvzDriver) < 0)
+        return -1;
     return 0;
 }
-- 
1.8.5.3

--
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]