summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorAtsushi Nemoto <atsushi.nemoto@sord.co.jp>2019-01-21 17:26:41 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-05 17:57:05 +0100
commit18b37b6b4250f76108cd4a50249887410cabbb63 (patch)
treefb52b43f24014c2b45730e65b7bb397dd7c73b4b /drivers/net
parentb7d012ec2a0d65490fd33e216aad73604adc3d36 (diff)
net: altera_tse: fix connect_local_phy error path
[ Upstream commit 17b42a20d7ca59377788c6a2409e77569570cc10 ] The connect_local_phy should return NULL (not negative errno) on error, since its caller expects it. Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp> Acked-by: Thor Thayer <thor.thayer@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index a0eee7218695..e306342506f1 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -692,8 +692,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev)
phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
priv->phy_iface);
- if (IS_ERR(phydev))
+ if (IS_ERR(phydev)) {
netdev_err(dev, "Could not attach to PHY\n");
+ phydev = NULL;
+ }
} else {
int ret;