Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3685257pxb; Mon, 24 Jan 2022 15:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO2KuyWV6Zh2QhilCYF7+zpYiDKOrNSO3dLc7P0MSR6J8JHbkQp3OIcv9aIJgNHYAU533e X-Received: by 2002:a63:a50f:: with SMTP id n15mr11608532pgf.428.1643066329510; Mon, 24 Jan 2022 15:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066329; cv=none; d=google.com; s=arc-20160816; b=t8xM5st3zC5vFmrV+8VwLoAR+GJsUlqreVp0IQqn+ZEx7whR006rvLCXyU3xIsL/Iv 5l0iyPzfvzWhnWzQ4F3GXO1X3QUxc/T2Tp3GS8wBO1ErnSVvCclquRwvgplH62OfVr5D IOnbcieAQp7VOvvMx9s3Fw+ZpTQI/gveP1z4wakDkRjcjncT5nmY7TtaqCJx+nGPGZpc E5IITVJmNiAlj3ugW0ClGJvKOR4+S/WrTX54X7qaL2Mm7NhivHtqL0xYID5XHbhEhOKm EOxIiW+w+y0CHZBkov7ooS7IXEr6FSGLAMYp2seB9De20UtHe07celqVfsb1xwMHW8U6 lK0A== 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=bwilYSjLCuOcDjld2hTFvg7xeDaAC8oCES48i3WdNczZqLbWs7McGutyZxHPYFqzCe wPSrZAGqzlQPLFTjRaVXQq/ghS5Q649QcFBuJSF9pBPrEJucQBdZP/PxG2VmdqW1SRrA 5VF/cqO8sh3QbGM8vuYkp8ADdc8ObcqDQiR9zbApIZtOHyy+O9nnOwF+q1HWIcHI7Tpi aNuuVUrl1Sb3xv4gwQy9fIviolOWqIGwUYj4xB1xXikxvsraVFAMXUyLqRWLFD571EKm z6HEj5M1ts0rHIOcGhe3pOFGTSPCWpVdoqQJEx9KDyMrFJoKaG/vy3SvkgOyXzac0Xjx UV0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="lc2P/Aft"; 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 i191si11594085pge.679.2022.01.24.15.18.37; Mon, 24 Jan 2022 15:18:49 -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="lc2P/Aft"; 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 S1846358AbiAXXPp (ORCPT + 99 others); Mon, 24 Jan 2022 18:15:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1584674AbiAXWVc (ORCPT ); Mon, 24 Jan 2022 17:21:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291F7C0424FE; Mon, 24 Jan 2022 12:52:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id DA2FAB80CCF; Mon, 24 Jan 2022 20:52:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10B22C340E5; Mon, 24 Jan 2022 20:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057562; bh=Fr/LKWtC4UyTPQgHsHi1fEAW/E12tFtoUubYw4q27BA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lc2P/Aft5jTaMPIJCLSXGnbJme7Sj+M6/hOn3P5ZNzdnUlA4W4o0R5Hm4/uXlKqCS EQtexxmkCeBw4ijJ8ZVoMsYvyj4AZRn5OvcYe5XthZ2tqXYv+bd6tZTnm+tNszJWqB 4SXd9OgzOpzc9SLf0fmprNO/jT0cGQcKjlSXS00c= 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.15 832/846] net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() Date: Mon, 24 Jan 2022 19:45:49 +0100 Message-Id: <20220124184129.612885100@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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) &&