summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
authorKarel Zak2014-07-17 14:08:18 +0200
committerKarel Zak2014-07-17 14:08:18 +0200
commitcba69bb55115470bb37d5d859a7ecdcadfd67aa8 (patch)
tree76375994c230688e40223c840538a5dbf2d84de8 /lib/loopdev.c
parentdocs: bring four more man pages closer to standard formatting (diff)
downloadkernel-qcow2-util-linux-cba69bb55115470bb37d5d859a7ecdcadfd67aa8.tar.gz
kernel-qcow2-util-linux-cba69bb55115470bb37d5d859a7ecdcadfd67aa8.tar.xz
kernel-qcow2-util-linux-cba69bb55115470bb37d5d859a7ecdcadfd67aa8.zip
lib/loopdev: comparing an array to null is not useful [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 2488a6fdb..2a2a31782 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -238,7 +238,7 @@ void loopcxt_enable_debug(struct loopdev_cxt *lc, int enable)
*/
char *loopcxt_strdup_device(struct loopdev_cxt *lc)
{
- if (!lc || !lc->device || !*lc->device)
+ if (!lc || !*lc->device)
return NULL;
return strdup(lc->device);
}
@@ -250,7 +250,7 @@ char *loopcxt_strdup_device(struct loopdev_cxt *lc)
*/
const char *loopcxt_get_device(struct loopdev_cxt *lc)
{
- return lc && lc->device && *lc->device ? lc->device : NULL;
+ return lc && *lc->device ? lc->device : NULL;
}
/*