Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2688386ybl; Thu, 29 Aug 2019 11:29:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjClXF6i6+65nXZBYY+3XPxTHPCP/XY14U+TpVroqkKy8Y4ESMlcz+EyTHJorZKBnvK9ja X-Received: by 2002:a65:640d:: with SMTP id a13mr9497482pgv.256.1567103396003; Thu, 29 Aug 2019 11:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567103395; cv=none; d=google.com; s=arc-20160816; b=WOtHzrN5Uy6ORp8I1NgNXwqJuvXACvw16B+58pGmuOnKJVn40ZpbyaaQJzVKGcS9H6 k91dlnGsBQNFYr4v0JbE0h2G5dAomLdhFz0OIT18a+sghiUnA+h7KimDUhSxxlMMIbwt jWYJcHMvdGkZztghGpxF+6HBmcHcd9NXJ7HLCOk/SGW+uMo4HVHxXZmUfmgycq7X3jjC JHxOVJ68N4Pvy7l+reh4n5tfIXLNIgrQTx59BFNxqTtdh+hZyotAhjDeAr0zk33pLqhN JON6v7xsBYiFfx8ThnfT22smUHa8yoEWlFDWmdMqCuhlmcOL8tNmu1iSlnM6HPF0a+Uv r3/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s3/cRpHZWSzUObKMVoEUxChh106NRQXF0uVQ0A6pg7A=; b=K632F2l1znPTwwxcHO/ccggYJXm/wwfG38JuGqbgMXppcp5WrtqJASrTAN7h+NJlWW JbkG0EKxOTsHbfX6L/7p0ukBi0BxmQ45L5S7Ufm1hKx4aiktsJE9Wb/W+Ck0WHTi3nQw LbyLskLlAgQlQtMG23DpBbzQT2uXCz5G/P8Cmvp5b7OmBAfhm5b/YHKrXmRN63QSN6Xz thzqthDo8wZWm1ASDPgv8wKDCXOK8z6dMhqgRS5R1ACCodlYfG6riWHLJ9x7y3L4Sh7B inIrIPPCH+dzi/tKyVfNg+b6lF7xVu6aiKJ54shr7E3u4wUP6zUmdVAzzzP+z3lhoyw1 vZZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IzCht8j1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si2670627pgp.423.2019.08.29.11.29.40; Thu, 29 Aug 2019 11:29:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IzCht8j1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729182AbfH2SPL (ORCPT + 99 others); Thu, 29 Aug 2019 14:15:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729125AbfH2SPE (ORCPT ); Thu, 29 Aug 2019 14:15:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1305B23407; Thu, 29 Aug 2019 18:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102503; bh=7Duq5gO18jH/qa/5J91ieVvtbecfCbQ9i5hLM1vO4xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IzCht8j124mUZtLsUokwbfFUX7FfL3FGZHWsPaZcdh5tRb2XdUtFGMEgpjoocC+UD BmdzHfKksX8eWSxb+6miofxufBRC/6rw055YmvEdZZ6YpWJRBlwf2LsduY0Gj9PsIL ytpYi+75jhieUds4ZIKqRlo2jt2cRlKKgy51/DxQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vitaly Kuznetsov , Sasha Levin , linux-hyperv@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 54/76] Tools: hv: kvp: eliminate 'may be used uninitialized' warning Date: Thu, 29 Aug 2019 14:12:49 -0400 Message-Id: <20190829181311.7562-54-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov [ 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 Signed-off-by: Sasha Levin --- tools/hv/hv_kvp_daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index d7e06fe0270ee..6d809abaf338a 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; -- 2.20.1