diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-02-18 12:55:42 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-18 18:07:10 -0500 |
commit | ce5eaf023a231ebd313ecc7e0b33278513d8ad80 (patch) | |
tree | 64fb973b58aed0765d2ca5689513cd0e6ea0806e /drivers/net/ethernet/freescale | |
parent | d7cf0c34af067555737193b6c1aa7abaa677f29c (diff) | |
download | op-kernel-dev-ce5eaf023a231ebd313ecc7e0b33278513d8ad80.zip op-kernel-dev-ce5eaf023a231ebd313ecc7e0b33278513d8ad80.tar.gz |
NET: fec: only enable napi if we are successful
If napi is left enabled after a failed attempt to bring the interface
up, we BUG:
fec 2188000.ethernet eth0: no PHY, assuming direct connection to switch
libphy: PHY fixed-0:00 not found
fec 2188000.ethernet eth0: could not attach to PHY
------------[ cut here ]------------
kernel BUG at include/linux/netdevice.h:502!
Internal error: Oops - BUG: 0 [#1] SMP ARM
...
PC is at fec_enet_open+0x4d0/0x500
LR is at __dev_open+0xa4/0xfc
Only enable napi after we are past all the failure paths.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index d4782b4..903362a 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1778,8 +1778,6 @@ fec_enet_open(struct net_device *ndev) struct fec_enet_private *fep = netdev_priv(ndev); int ret; - napi_enable(&fep->napi); - /* I should reset the ring buffers here, but I don't yet know * a simple way to do that. */ @@ -1794,6 +1792,8 @@ fec_enet_open(struct net_device *ndev) fec_enet_free_buffers(ndev); return ret; } + + napi_enable(&fep->napi); phy_start(fep->phy_dev); netif_start_queue(ndev); fep->opened = 1; |