summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2019-08-19 16:44:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-10 10:33:50 +0100
commit5bbebceec61da09361d944077b9e7cf198d62f78 (patch)
treefbc45f5cacbc9e1ed2d0cbdc08cac07c3ab360fc
parent1d42e40fe3c5c78ea856f3307f74f082839515fd (diff)
downloadlinux-stable-5bbebceec61da09361d944077b9e7cf198d62f78.tar.gz
linux-stable-5bbebceec61da09361d944077b9e7cf198d62f78.tar.bz2
linux-stable-5bbebceec61da09361d944077b9e7cf198d62f78.zip
Tools: hv: kvp: eliminate 'may be used uninitialized' warning
[ Upstream commit 89eb4d8d25722a0a0194cf7fa47ba602e32a6da7 ] When building hv_kvp_daemon GCC-8.3 complains: hv_kvp_daemon.c: In function ‘kvp_get_ip_info.constprop’: hv_kvp_daemon.c:812:30: warning: ‘ip_buffer’ may be used uninitialized in this function [-Wmaybe-uninitialized] struct hv_kvp_ipaddr_value *ip_buffer; this seems to be a false positive: we only use ip_buffer when op == KVP_OP_GET_IP_INFO and it is only unset when op == KVP_OP_ENUMERATE. Silence the warning by initializing ip_buffer to NULL. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--tools/hv/hv_kvp_daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 0ce50c319cfd..ef8a82f29f02 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -809,7 +809,7 @@ kvp_get_ip_info(int family, char *if_name, int op,
int sn_offset = 0;
int error = 0;
char *buffer;
- struct hv_kvp_ipaddr_value *ip_buffer;
+ struct hv_kvp_ipaddr_value *ip_buffer = NULL;
char cidr_mask[5]; /* /xyz */
int weight;
int i;