]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: check blkid_probe_lookup_values() return [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 12:10:58 +0000 (13:10 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 12:10:58 +0000 (13:10 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index ae5e589377d67f206477d60caa24e72b94c38210..b963da265e67019ea67580e434ffa6f2d291b2af 100644 (file)
@@ -407,10 +407,10 @@ wipe_device(int fd, const char *devname, int force, int is_blkdev)
                        blkid_probe_enable_partitions(pr, 1);
                        blkid_probe_enable_superblocks(pr, 0);
 
-                       if (blkid_do_fullprobe(pr) == 0)
-                               blkid_probe_lookup_value(pr, "PTTYPE",
-                                               (const char **) &type, NULL);
-                       if (type) {
+                       if (blkid_do_fullprobe(pr) == 0 &&
+                           blkid_probe_lookup_value(pr, "PTTYPE",
+                                       (const char **) &type, NULL) == 0 &&
+                           type) {
                                type = xstrdup(type);
                                zap = 0;
                        }