Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zhengchao Shao and committed by
Paolo Abeni
ce9e57fe f0dfc4c8

+3 -1
+3 -1
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
··· 1004 1004 1005 1005 xgene_enet_napi_enable(pdata); 1006 1006 ret = xgene_enet_register_irq(ndev); 1007 - if (ret) 1007 + if (ret) { 1008 + xgene_enet_napi_disable(pdata); 1008 1009 return ret; 1010 + } 1009 1011 1010 1012 if (ndev->phydev) { 1011 1013 phy_start(ndev->phydev);