Skip to contentSkip to conversation

master - coverity: fix NULL check in lv->lvid.s

PATCH Peter Rajnoha 1 participant 1 message Jul 8, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6b48233f2548621c42129b8f0e2911e05c206660
Commit:        6b48233f2548621c42129b8f0e2911e05c206660
Parent:        3ec4813ba22adedb8914089b6f17fe779d76ee77
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Wed Jul 8 15:08:39 2015 +0200
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Wed Jul 8 15:08:39 2015 +0200

coverity: fix NULL check in lv->lvid.s

tools/polldaemon.c:457: array_null: Comparing an array to null is not useful: "lv->lvid.s"

The lv->lvid.s is never NULL. The check was supposed to be *lv->lvid.s to check if the string is not empty.

---
 tools/polldaemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/polldaemon.c +1 -1
index ab9e474..bbe4641 100644
@@ -454,7 +454,7 @@ static int _lvmpolld_init_poll_vg(struct cmd_context *cmd, const char *vgname,
 		if (!id.display_name && !lpdp->parms->aborting)
 			continue;
 
-		if (!lv->lvid.s) {
+		if (!*lv->lvid.s) {
 			log_print_unless_silent("Missing LV uuid within: %s/%s", id.vg_name, id.lv_name);
 			continue;
 		}