Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4122389ybe; Mon, 9 Sep 2019 04:42:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMWHkKIPwJMvs4aQsNIohCrVeeNXfTaM4Oi2mEEEMovfmcduMKxSHKZyB2EGCPZgrJ1c2Y X-Received: by 2002:a50:adea:: with SMTP id b39mr23496077edd.16.1568029323113; Mon, 09 Sep 2019 04:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568029323; cv=none; d=google.com; s=arc-20160816; b=v3SoIJ7McvCzU/WNzDbaTh+KiSADMeqUOuAdZO58+fdzS+BmKzE/gXV2UFJgb5FPQH TkCrWMDfokGwUO3BLqMNNxlu/raXn08UoRLGoj8wia0L4EJiLXjkfsksI4/DvDtUOduj HzkapHcprX5cFK5s+px3tlHYB3YcQLVhNzHGwUJk6m6zxb4j7WJqM2rDSY7FtoOcWPiJ 0J5XbbpfPhuNByvQCZWyPwa+F/UKTTXN2ZNfkROb3AKm3xuc9qbjITspJr8iATuIVZDS GvckXqPl45tFFLTD9PSlUIF+Lc1ZpO0TYp4tUak3TFOVuQe9ajy5MsPJOe0nwxpXPTKK iHqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ruD7YEVxBOhe91vsM+PjFXT6eop+yOumVtIpzfTHTic=; b=RYMmIHP1p7G2Z0wFhRu5IvX28phxkBacKkg3bweN6/YAnrJ0XRNvszUuI8ihR3B3Nz U+QlOVZw/OjyrXYv/YubZQKaDF/vNQeWgqUUjYqXz1xJp37+GtV38qTj5767/NwYKiUh vfOIWOu6Q4vnG7jZ0sXywG0QXIj14kHD9YO4UGR0lC4B1HDnAXp6kVV9rMnQqwYKhhJJ T7BIaePrv/On87dYb4aB7wWyiw8IMuCs9p99bal2WzdCNveBs12Q/aC9DlYh7E9GQZ7Q SvWsJkG66pk+bLfxd50fcZ/Ui6qEO1tI7yVjbCy46ozbDou3O8fC92gyBjYykrcdrb7V z5Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nfirDaDF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id op6si7157207ejb.229.2019.09.09.04.41.39; Mon, 09 Sep 2019 04:42:03 -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=nfirDaDF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730984AbfIHMsW (ORCPT + 99 others); Sun, 8 Sep 2019 08:48:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730945AbfIHMsR (ORCPT ); Sun, 8 Sep 2019 08:48:17 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67E1221A49; Sun, 8 Sep 2019 12:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946896; bh=DOSF6AukBROLlNk0BEl1Q7MOQ+QargqIcHwxqCxuppA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfirDaDFWgFL4BkqgHfuiA8uXyzuSTUpOzlV8svimKA9Mb4u6uVYliehK1FA9l482 BJgoPbyZQx6WXWnRQI7/ly44tl0ELBheEUaQN2yVaBpvf/0uftNfL92t5luM7Im+Wh Lykq43kg+VE7RYzWLyYPfSyH2ktsV8lYeDrciaZk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , Sasha Levin Subject: [PATCH 4.19 42/57] Tools: hv: kvp: eliminate may be used uninitialized warning Date: Sun, 8 Sep 2019 13:42:06 +0100 Message-Id: <20190908121144.692262521@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 0ce50c319cfd6..ef8a82f29f024 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