]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage_driver: Resolve Coverity CHECKED_RETURN warning
authorJohn Ferlan <jferlan@redhat.com>
Mon, 2 Dec 2013 20:31:42 +0000 (15:31 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 4 Dec 2013 11:27:20 +0000 (06:27 -0500)
The storageRegister() didn't check the return from the
virRegisterStorageDriver() like other callers did, so Coverity
flagged it.  Just check the return and handle.

src/storage/storage_driver.c

index 3b4715a240710daa12ec89cb26c85e84461fe12f..f08255ea0e462c1741c45fd7a3d73b282db6c6e8 100644 (file)
@@ -2644,8 +2644,10 @@ static virStateDriver stateDriver = {
     .stateReload = storageStateReload,
 };
 
-int storageRegister(void) {
-    virRegisterStorageDriver(&storageDriver);
+int storageRegister(void)
+{
+    if (virRegisterStorageDriver(&storageDriver) < 0)
+        return -1;
     virRegisterStateDriver(&stateDriver);
     return 0;
 }