]> 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:25:35 +0000 (08:25 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 20 May 2022 14:25:40 +0000 (08:25 -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>
src/config.c

index 96227b280757b4c1f75c4f70d1c0a24773a9b0b7..56876fb6c20c00564570b4df484de30b56860042 100644 (file)
@@ -973,8 +973,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);