[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200217233518.3159-2-hauke@hauke-m.de>
Date: Tue, 18 Feb 2020 00:35:17 +0100
From: Hauke Mehrtens <hauke@...ke-m.de>
To: davem@...emloft.net, linux@...pel-privat.de
Cc: netdev@...r.kernel.org, jcliburn@...il.com, chris.snook@...il.com,
Hauke Mehrtens <hauke@...ke-m.de>
Subject: [PATCH 2/3] ag71xx: Call ag71xx_hw_disable() in case phy_conenct fails
When the ag71xx_phy_connect() failed only parts of the actions done
previously in this function were reverted, because only
ag71xx_rings_cleanup() was called. My system crashed the next time
open() was called because napi_disable() was not called again and this
resulted in two calls to napi_enable(), which is not allowed.
Fix this by disabling the device again.
Signed-off-by: Hauke Mehrtens <hauke@...ke-m.de>
Fixes: d51b6ce441d3 ("net: ethernet: add ag71xx driver")
---
drivers/net/ethernet/atheros/ag71xx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 6f7281f38d5a..7d3fec009030 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1263,18 +1263,18 @@ static int ag71xx_open(struct net_device *ndev)
ret = ag71xx_hw_enable(ag);
if (ret)
- goto err;
+ return ret;
ret = ag71xx_phy_connect(ag);
if (ret)
- goto err;
+ goto err_hw_disable;
phy_start(ndev->phydev);
return 0;
-err:
- ag71xx_rings_cleanup(ag);
+err_hw_disable:
+ ag71xx_hw_disable(ag);
return ret;
}
--
2.20.1
Powered by blists - more mailing lists