diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-10-18 00:16:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-18 14:20:36 -0400 |
commit | 4b75ca5a7a9e01dda3ea70bc17b1826fd679af61 (patch) | |
tree | 8314c3c865dd117e007705dba990698d2ce9534e /drivers/net/ethernet | |
parent | 41ee9c557ef5de992843b6dac35a199e651525cf (diff) | |
download | linux-stable-4b75ca5a7a9e01dda3ea70bc17b1826fd679af61.tar.gz linux-stable-4b75ca5a7a9e01dda3ea70bc17b1826fd679af61.tar.bz2 linux-stable-4b75ca5a7a9e01dda3ea70bc17b1826fd679af61.zip |
net: bcm63xx: avoid referencing uninitialized variable
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 <tremyfr@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index ae364c74baf3..537090952c45 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1126,7 +1126,8 @@ out_freeirq: free_irq(dev->irq, dev); out_phy_disconnect: - phy_disconnect(phydev); + if (priv->has_phy) + phy_disconnect(phydev); return ret; } |