Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034323AbcJRSVH (ORCPT ); Tue, 18 Oct 2016 14:21:07 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:45034 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030378AbcJRSVG (ORCPT ); Tue, 18 Oct 2016 14:21:06 -0400 Date: Tue, 18 Oct 2016 14:21:04 -0400 (EDT) Message-Id: <20161018.142104.1792947498376488428.davem@davemloft.net> To: arnd@arndb.de Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, tremyfr@gmail.com, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 20/28] net: bcm63xx: avoid referencing uninitialized variable From: David Miller In-Reply-To: <20161017221650.1902729-1-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> <20161017221650.1902729-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 18 Oct 2016 11:21:05 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 20 From: Arnd Bergmann Date: Tue, 18 Oct 2016 00:16:08 +0200 > gcc found a reference to an uninitialized variable in the error handling > of bcm_enet_open, introduced by a recent cleanup: > > drivers/net/ethernet/broadcom/bcm63xx_enet.c: In function 'bcm_enet_open' > drivers/net/ethernet/broadcom/bcm63xx_enet.c:1129:2: warning: 'phydev' may be used uninitialized in this function [-Wmaybe-uninitialized] > > This makes the use of that variable conditional, so we only reference it > here after it has been used before. Unlike my normal patches, I have not > build-tested this one, as I don't currently have mips test in my > randconfig setup. > > Fixes: 625eb8667d6f ("net: ethernet: broadcom: bcm63xx: use phydev from struct net_device") > Cc: Philippe Reynes > Reported-by: kbuild test robot > Signed-off-by: Arnd Bergmann Applied.