drivers: net: xgene: disable napi when register irq failed in xgene_enet_open()
authorZhengchao Shao <shaozhengchao@huawei.com>
Mon, 7 Nov 2022 04:30:32 +0000 (12:30 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Nov 2022 14:15:55 +0000 (15:15 +0100)
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>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c

index d6cfea65a714030d3662915f9103c3ac36724b18..390671640388bd5d1b7f26d14f50499de5f98190 100644 (file)
@@ -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);