diff options
author | Karel Zak | 2012-01-31 14:47:53 +0100 |
---|---|---|
committer | Karel Zak | 2012-01-31 14:47:53 +0100 |
commit | c03d12d87412df1080b5122feda479d3454b38fd (patch) | |
tree | 32f33b3fc461ec84cef9410ffa098c562a69c39b /libblkid | |
parent | libmount: consolidate sysconf() usage (diff) | |
download | kernel-qcow2-util-linux-c03d12d87412df1080b5122feda479d3454b38fd.tar.gz kernel-qcow2-util-linux-c03d12d87412df1080b5122feda479d3454b38fd.tar.xz kernel-qcow2-util-linux-c03d12d87412df1080b5122feda479d3454b38fd.zip |
libblkid: comparing an array to null is not useful [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/partitions/partitions.c | 2 | ||||
-rw-r--r-- | libblkid/src/probe.c | 4 | ||||
-rw-r--r-- | libblkid/src/superblocks/superblocks.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c index 80a6e8849..99ec5d158 100644 --- a/libblkid/src/partitions/partitions.c +++ b/libblkid/src/partitions/partitions.c @@ -533,7 +533,7 @@ int blkid_is_nested_dimension(blkid_partition par, static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id, struct blkid_chain *chn) { - const struct blkid_idmag *mag; + const struct blkid_idmag *mag = NULL; blkid_loff_t off; int rc = 1; /* = nothing detected */ diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index fc7cd2c20..d7f24b28c 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -774,7 +774,7 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id, blkid_loff_t off = 0; if (id) - mag = id->magics ? &id->magics[0] : NULL; + mag = &id->magics[0]; if (res) *res = NULL; @@ -799,7 +799,7 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id, mag++; } - if (id && id->magics && id->magics[0].magic) + if (id && id->magics[0].magic) /* magic string(s) defined, but not found */ return 1; diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c index ea50dbc39..e465eb154 100644 --- a/libblkid/src/superblocks/superblocks.c +++ b/libblkid/src/superblocks/superblocks.c @@ -357,8 +357,6 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn) if (id->minsz && id->minsz > pr->size) continue; /* the device is too small */ - mag = id->magics ? &id->magics[0] : NULL; - /* don't probe for RAIDs, swap or journal on CD/DVDs */ if ((id->usage & (BLKID_USAGE_RAID | BLKID_USAGE_OTHER)) && blkid_probe_is_cdrom(pr)) |