From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40ED2C4332F for ; Sun, 8 Sep 2019 12:48:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F89C2190F for ; Sun, 8 Sep 2019 12:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946899; bh=DOSF6AukBROLlNk0BEl1Q7MOQ+QargqIcHwxqCxuppA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Vf6TKWBuJ61g4x2Dx/vjx4R37kARGVetuGmS2C8hMZE3AfL9aIuhUD/ZM0ZRCcjms QU/Kx8EQmi4ESu/dAOzENHf9LKInWN1/trdc7g9VRLZ+BaJ+HHpybtYICd3QvfoKdU ocfoWI4OttdQvka1JhxJTRk7wKlrodHxyyuLiN4k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730950AbfIHMsR (ORCPT ); Sun, 8 Sep 2019 08:48:17 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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