[CRIU] [PATCH 16/18] cgroup: print errors of umount2 and rmdir

Andrei Vagin avagin at openvz.org
Thu Nov 9 22:21:10 MSK 2017


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 6 out of 7 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 de7ca7238..3ae52d325 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