mount: fix uninitialized use of fd on switch_ns error
close_safe can operate uninitialized fd in case of error in switch_ns, found by Coverity Scan: *** CID 187164: Uninitialized variables (UNINIT) /criu/mount.c: 1313 in open_mountpoint() 1307 err: 1308 return 1; 1309 } 1310 1311 int open_mountpoint(struct mount_info *pm) 1312 { >>> CID 187164: Uninitialized variables (UNINIT) >>> Declaring variable "fd" without initializer. 1313 int fd, cwd_fd, ns_old = -1; 1314 1315 /* No overmounts and children - the entire mount is visible */ 1316 if (list_empty(&pm->children) && !mnt_is_overmounted(pm)) 1317 return __open_mountpoint(pm, -1); 1318 Signed-off-by:Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
Showing
Please
register
or
sign in
to comment