Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3970928pxb; Tue, 25 Jan 2022 00:17:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwglylsQlW/KkAOv+P0aSqQkPWS4tKF10zMNZ5tU0ZT0wIChATnl27UUBqDsy72/i/mvJvN X-Received: by 2002:a17:906:7302:: with SMTP id di2mr15478053ejc.322.1643098678689; Tue, 25 Jan 2022 00:17:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098678; cv=none; d=google.com; s=arc-20160816; b=YGqPTu6VHrqvgOa9KMSxkEGX4GILDs7jm1hL3Syy/onAufDAjnfmb62goLr39pKnxQ X2X8xogSb3Ef6jJJHPXA8eDv8+URB2yDaEoA/B6TmaSyRCe4EWuz0GTuaDK03Xvxz+wm I45+jG0lgXY+sh8YJCzA0pTd4v8FVCHWTFVE7mCzrnql1pZSFkjm6yH+kmEUZdRD9FEU lLZLOYBXYAo93+pf2BgIxQGqCEzHCh4gHyrXXdMSBKOJEXDt1GJvtAQTsFWTJe+9SVBK YeGRciMwzJ/gcxp3u32BWHQmISY5pK7LmYOtxv0NixmMxbcIafrTdQNhieOfsE97uheV uUFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2MqtgJsdGhzR1WGRepaWizPxToWX9Kw9eK9+DNjNOIc=; b=bmHpIWm6SsXt2I5BNBWr2vKU2iIuW9HYOtKyfbtOaTRnVg/9Ber2lySl8kXq9hDL7L IbRjO43vWybWaN5rVckxOmhyTISJuYzTI9mJ8vBJfjn/bQ4B+fPXodBmudTDpcjtVhSr QI6XKkgBKD0ZDo9ct/wChhEx3Wv0CsaszrniOe7ozuo1l4lrclz8ppHqLMeQTyc+SIcR w4it2LhJKttG/9DHU0S4CEdfw9Z7yFLn2E1vNPVH1ASwQOYh+qOKM48rGrINc92PCnFM faRFeOZsqknX2KVybl/8d5P9dPGS9Z2fcLX1dTkUDGLYTAob7UpMvN4Hndm9390Cs3IJ 9BPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="HO/slpzr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd29si13974461ejc.75.2022.01.25.00.17.24; Tue, 25 Jan 2022 00:17:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="HO/slpzr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3412423AbiAYAgz (ORCPT + 99 others); Mon, 24 Jan 2022 19:36:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2366246AbiAXXwd (ORCPT ); Mon, 24 Jan 2022 18:52:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E1B0C047CFC; Mon, 24 Jan 2022 13:45:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C68B60917; Mon, 24 Jan 2022 21:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 243C2C340E4; Mon, 24 Jan 2022 21:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060730; bh=Fr/LKWtC4UyTPQgHsHi1fEAW/E12tFtoUubYw4q27BA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HO/slpzrqBNDA/9Zn8+FjhamuHxH0vSK5IMXIv2W4xUARQCFvc4A/NHOcuztWcNph NioWHizEP/8QSJguwrtULXW6/FVZdBBk/w2CsaV6aEeZp7QsPbVzTgX8G+60PsIGIO 8oWFJoZ3SwRShgIsKuMbdhwoLmMwBtddl0gs/1ac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , "David S. Miller" Subject: [PATCH 5.16 1016/1039] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() Date: Mon, 24 Jan 2022 19:46:45 +0100 Message-Id: <20220124184159.451000912@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix commit 214b3369ab9b0a6f28d6c970220c209417edbc65 upstream. Clang static analysis reports this problem mtk_eth_soc.c:394:7: warning: Branch condition evaluates to a garbage value if (err) ^~~ err is not initialized and only conditionally set. So intitialize err. Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII") Signed-off-by: Tom Rix Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -224,7 +224,7 @@ static void mtk_mac_config(struct phylin phylink_config); struct mtk_eth *eth = mac->hw; u32 mcr_cur, mcr_new, sid, i; - int val, ge_mode, err; + int val, ge_mode, err = 0; /* MT76x8 has no hardware settings between for the MAC */ if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&