aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/apm/xgene
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-11-07 12:30:32 +0800
committerPaolo Abeni <pabeni@redhat.com>2022-11-08 15:15:55 +0100
commitce9e57feeed81d17d5e80ed86f516ff0d39c3867 (patch)
tree565a6e18380cae9d9fb77dd3a3c3fada5d46c1ec /drivers/net/ethernet/apm/xgene
parentocteontx2-pf: Fix SQE threshold checking (diff)
downloadlinux-dev-ce9e57feeed81d17d5e80ed86f516ff0d39c3867.tar.xz
linux-dev-ce9e57feeed81d17d5e80ed86f516ff0d39c3867.zip
drivers: net: xgene: disable napi when register irq failed in xgene_enet_open()
When failed to register irq in xgene_enet_open() for opening device, napi isn't disabled. When open xgene device next time, it will reports a invalid opcode issue. Fix it. Only be compiled, not be tested. Fixes: aeb20b6b3f4e ("drivers: net: xgene: fix: ifconfig up/down crash") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Link: https://lore.kernel.org/r/20221107043032.357673-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/apm/xgene')
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index d6cfea65a714..390671640388 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -1004,8 +1004,10 @@ static int xgene_enet_open(struct net_device *ndev)
xgene_enet_napi_enable(pdata);
ret = xgene_enet_register_irq(ndev);
- if (ret)
+ if (ret) {
+ xgene_enet_napi_disable(pdata);
return ret;
+ }
if (ndev->phydev) {
phy_start(ndev->phydev);