Linux Device Mapper development
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>,
	Martin Wilck <mwilck@suse.com>
Subject: [PATCH 3/4] multipath: fix clang warning in delegate_to_multipathd
Date: Thu,  8 Mar 2018 00:08:58 +0100	[thread overview]
Message-ID: <20180307230859.14926-4-mwilck@suse.com> (raw)
In-Reply-To: <20180307230859.14926-1-mwilck@suse.com>

Fixes this warning from clang:

main.c:628:11: warning: variable 'reply' is used uninitialized
whenever 'if' condition is true [-Wsometimes-uninitialized]
...
main.c:609:32: note: initialize the variable 'reply' to silence this warning

Fixes: 506d253b7f89 "multipath: delegate dangerous commands to multipathd"
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipath/main.c b/multipath/main.c
index 8732cf8bd930..716203eab56c 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -606,7 +606,7 @@ int delegate_to_multipathd(enum mpath_cmds cmd, const char *dev,
 			   enum devtypes dev_type, const struct config *conf)
 {
 	int fd;
-	char command[1024], *p, *reply;
+	char command[1024], *p, *reply = NULL;
 	int n, r = 0;
 
 	fd = mpath_connect();
-- 
2.16.1

  parent reply	other threads:[~2018-03-07 23:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 23:08 [PATCH 0/4] multipath-tools: important fixes for 0.7.5 Martin Wilck
2018-03-07 23:08 ` [PATCH 1/4] libmultipath: fix crash on shutdown if io_err thread isn't running Martin Wilck
2018-03-07 23:08 ` [PATCH 2/4] multipathd: fix -Wpointer-to-int-cast warning in uxlsnr Martin Wilck
2018-03-07 23:08 ` Martin Wilck [this message]
2018-03-07 23:08 ` [PATCH 4/4] multipath-tools: build: prevent intermediate file deletion Martin Wilck
2018-03-08 16:04 ` [PATCH 0/4] multipath-tools: important fixes for 0.7.5 Xose Vazquez Perez
2018-03-10  7:43   ` Christophe Varoqui
2018-03-27 19:39     ` Michael Laß
2018-03-27 20:55       ` Christophe Varoqui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307230859.14926-4-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=xose.vazquez@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox