summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2019-05-14 16:43:40 +0200
committerKarel Zak2019-05-14 16:43:40 +0200
commit3011b381e3feddfd1173fd293e024aeba58ded3b (patch)
tree7d91e5a3f5e3bdf847c00292e34a5c1fc8147c50 /lib
parentlib/colors: keep static analyzer happy [coverity scan] (diff)
downloadkernel-qcow2-util-linux-3011b381e3feddfd1173fd293e024aeba58ded3b.tar.gz
kernel-qcow2-util-linux-3011b381e3feddfd1173fd293e024aeba58ded3b.tar.xz
kernel-qcow2-util-linux-3011b381e3feddfd1173fd293e024aeba58ded3b.zip
losetup: keep static analyzer happy [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/loopdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 952adb872..4610e9192 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -1034,8 +1034,8 @@ int loopcxt_is_used(struct loopdev_cxt *lc,
uint64_t sizelimit,
int flags)
{
- ino_t ino;
- dev_t dev;
+ ino_t ino = 0;
+ dev_t dev = 0;
if (!lc)
return 0;
@@ -1067,12 +1067,12 @@ int loopcxt_is_used(struct loopdev_cxt *lc,
return 0;
found:
if (flags & LOOPDEV_FL_OFFSET) {
- uint64_t off;
+ uint64_t off = 0;
int rc = loopcxt_get_offset(lc, &off) == 0 && off == offset;
if (rc && flags & LOOPDEV_FL_SIZELIMIT) {
- uint64_t sz;
+ uint64_t sz = 0;
return loopcxt_get_sizelimit(lc, &sz) == 0 && sz == sizelimit;
} else