[CRIU] [PATCH 7/8] cgroup: print errors for umount and rmdir
Andrei Vagin
avagin at openvz.org
Fri Feb 16 10:21:19 MSK 2018
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]
From: Andrei Vagin <avagin at virtuozzo.com>
CID 155804 (#1 of 1): Unchecked return value (CHECKED_RETURN)
2. check_return: Calling umount2 without checking return value (as is done elsewhere 8 out of 9 times).
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
criu/cgroup.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/criu/cgroup.c b/criu/cgroup.c
index ac15da264..8df6a3b83 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -1163,8 +1163,10 @@ void fini_cgroup(void)
return;
close_service_fd(CGROUP_YARD);
- umount2(cg_yard, MNT_DETACH);
- rmdir(cg_yard);
+ if (umount2(cg_yard, MNT_DETACH))
+ pr_perror("Unable to umount %s", cg_yard);
+ if (rmdir(cg_yard))
+ pr_perror("Unable to remove %s", cg_yard);
xfree(cg_yard);
cg_yard = NULL;
}
--
2.13.6
More information about the CRIU
mailing list