]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: add assert() to umount lookup code
authorKarel Zak <kzak@redhat.com>
Thu, 25 Mar 2021 09:51:54 +0000 (10:51 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 25 Mar 2021 09:51:54 +0000 (10:51 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_umount.c

index df9a2ebf54095a23949d2c34f68ddc02f8e29749..f54528f12c5bc3eb6360154ac6d98f0d635cbe24 100644 (file)
@@ -253,6 +253,9 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg
        struct stat st;
        const char *type;
 
+       assert(cxt);
+       assert(cxt->fs);
+
        DBG(CXT, ul_debugobj(cxt, " lookup by statfs"));
 
        /*
@@ -318,6 +321,9 @@ static int lookup_umount_fs_by_mountinfo(struct libmnt_context *cxt, const char
        struct libmnt_fs *fs = NULL;
        int rc;
 
+       assert(cxt);
+       assert(cxt->fs);
+
        DBG(CXT, ul_debugobj(cxt, " lookup by mountinfo"));
 
        /* search */