]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
src/config: fix coverity warning about add missing unlock()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 20 May 2022 14:29:04 +0000 (08:29 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 20 May 2022 14:29:11 +0000 (08:29 -0600)
Add missing unlock() of cg_mount_table_lock, reported by Coverity tool:

CID 1412126 (#1 of 1): Missing unlock (LOCK). missing_unlock:
Returning without unlocking cg_mount_table_lock.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 750388bda000a1ac00550ae400a4b5ace3dc1c37)

src/config.c

index 1306033bf2d629052ead63beb2e5a08f42335a27..32a44b88061f3c6b6898d793960c41713abce932 100644 (file)
@@ -976,8 +976,10 @@ static int config_order_namespace_table(void)
                                }
                        }
                }
-               if (!flag)
-                       return ECGNAMESPACECONTROLLER;
+               if (!flag) {
+                       error = ECGNAMESPACECONTROLLER;
+                       break;
+               }
        }
 error_out:
        pthread_rwlock_unlock(&cg_mount_table_lock);