diff options
author | Karel Zak | 2013-03-25 09:17:52 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-25 09:17:52 +0100 |
commit | 52a285bf4e8d3a78d7211694977f5894a748bdac (patch) | |
tree | a627191990c4fc996758275a5c821702b6957bec /libmount/src/context_umount.c | |
parent | build-sys: release++ (v2.23-rc1) (diff) | |
download | kernel-qcow2-util-linux-52a285bf4e8d3a78d7211694977f5894a748bdac.tar.gz kernel-qcow2-util-linux-52a285bf4e8d3a78d7211694977f5894a748bdac.tar.xz kernel-qcow2-util-linux-52a285bf4e8d3a78d7211694977f5894a748bdac.zip |
libmount: umount crashes when trying to umount a non-mountpoint
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r-- | libmount/src/context_umount.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 113c53e07..96ae87ae1 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -183,7 +183,7 @@ err: static int lookup_umount_fs(struct libmnt_context *cxt) { const char *tgt; - struct libmnt_fs *fs; + struct libmnt_fs *fs = NULL; int rc; assert(cxt); @@ -198,7 +198,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) rc = mnt_context_find_umount_fs(cxt, tgt, &fs); if (rc < 0) return rc; - if (!fs) { + if (rc == 1 || !fs) { DBG(CXT, mnt_debug_h(cxt, "umount: cannot find %s in mtab", tgt)); return 0; } |