From: Karel Zak Date: Tue, 31 Jan 2012 12:10:58 +0000 (+0100) Subject: mkswap: check blkid_probe_lookup_values() return [coverity scan] X-Git-Tag: v2.21-rc2~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c596a054506d9abbb63b99967584f467ffb34031;p=thirdparty%2Futil-linux.git mkswap: check blkid_probe_lookup_values() return [coverity scan] Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index ae5e589377..b963da265e 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -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; }