]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: keep it easy for static analyzers
authorKarel Zak <kzak@redhat.com>
Thu, 16 May 2019 12:38:12 +0000 (14:38 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 May 2019 12:38:12 +0000 (14:38 +0200)
misc-utils/findmnt.c

index eea772f0e6d5cf228b301ec3b50b0e6fd0cc828e..06db03986fbb23c5dac933a5b2c3978be06ee8d3 100644 (file)
@@ -989,7 +989,8 @@ struct libmnt_fs *get_next_fs(struct libmnt_table *tb,
                 *    findmnt [-l] <spec> [-O <options>] [-t <types>]
                 */
 again:
-               mnt_table_find_next_fs(tb, itr, match_func,  NULL, &fs);
+               if (mnt_table_find_next_fs(tb, itr, match_func,  NULL, &fs) != 0)
+                       fs = NULL;
 
                if (!fs &&
                    !(flags & FL_NOSWAPMATCH) &&