Skip to content

Commit

Permalink
drivers: net: xgene: disable napi when register irq failed in xgene_e…
Browse files Browse the repository at this point in the history
…net_open()

[ Upstream commit ce9e57f ]

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: aeb20b6 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
zhengchaoshao authored and gregkh committed Nov 16, 2022
1 parent 015e3c0 commit aab600c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/apm/xgene/xgene_enet_main.c
Expand Up @@ -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);
Expand Down

0 comments on commit aab600c

Please sign in to comment.