[dm-devel] [PATCH 3/4] multipath: fix clang warning in delegate_to_multipathd
Martin Wilck
mwilck at suse.com
Wed Mar 7 23:08:58 UTC 2018
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 at gmail.com>
Signed-off-by: Martin Wilck <mwilck at 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
More information about the dm-devel
mailing list