]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
config: remove dead code in config_validate_namespaces()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 8 Jul 2022 16:30:23 +0000 (10:30 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 8 Jul 2022 16:30:27 +0000 (10:30 -0600)
Remove the logically dead code, reported by the Coverity tool:

CID 258280 (#1 of 1): Logically dead code (DEADCODE)dead_error_begin:
Execution cannot reach this statement: last_errno = *__errno_locat....

cg_mount_table[i].mount.path can never be NULL, so remove that check in
the config_validate_namespaces().

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

src/config.c

index 774f0d7022af608707fb61f0b5cad805592f781d..dfabbd100d987a6308601784e416519c6f98432a 100644 (file)
@@ -846,12 +846,6 @@ static int config_validate_namespaces(void)
                 */
                mount_path = cg_mount_table[i].mount.path;
 
-               if (!mount_path) {
-                       last_errno = errno;
-                       error = ECGOTHER;
-                       goto out_error;
-               }
-
                /*
                 * Setup the namespace for the subsystems having the same
                 * mount point.