From 04c1634dfc55af46e65391bbab9a24e885f3020a Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 8 Feb 2018 21:18:22 +0300 Subject: [PATCH] cgroup: print errors for umount and rmdir 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). --- 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; }