summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_umount.c
diff options
context:
space:
mode:
authorKarel Zak2015-08-04 13:21:42 +0200
committerKarel Zak2015-08-04 13:21:42 +0200
commitcba392b661d3fcf92d50d0df7c8783e18bb992da (patch)
treecad7faaf330e273e359fe0a1800642d8eeadc396 /libmount/src/context_umount.c
parentlibfdisk: cleanup assert() usage (diff)
downloadkernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.tar.gz
kernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.tar.xz
kernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.zip
libmount: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r--libmount/src/context_umount.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 134c92b6e..c4e9ebbee 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -368,9 +368,6 @@ static int evaluate_permissions(struct libmnt_context *cxt)
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt || !cxt->fs)
- return -EINVAL;
-
if (!mnt_context_is_restricted(cxt))
return 0; /* superuser mount */
@@ -749,11 +746,6 @@ int mnt_context_prepare_umount(struct libmnt_context *cxt)
{
int rc;
- assert(cxt);
- assert(cxt->fs);
- assert(cxt->helper_exec_status == 1);
- assert(cxt->syscall_status == 1);
-
if (!cxt || !cxt->fs || mnt_fs_is_swaparea(cxt->fs))
return -EINVAL;
if (!mnt_context_get_source(cxt) && !mnt_context_get_target(cxt))
@@ -761,6 +753,9 @@ int mnt_context_prepare_umount(struct libmnt_context *cxt)
if (cxt->flags & MNT_FL_PREPARED)
return 0;
+ assert(cxt->helper_exec_status == 1);
+ assert(cxt->syscall_status == 1);
+
free(cxt->helper); /* be paranoid */
cxt->helper = NULL;
cxt->action = MNT_ACT_UMOUNT;