]> git.baikalelectronics.ru Git - kernel.git/commit
NET: fec: only enable napi if we are successful
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 18 Feb 2014 12:55:42 +0000 (12:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2014 23:07:10 +0000 (18:07 -0500)
commit88fa4247dab90cd5947a984b7ce06db2801ee20f
tree64fb973b58aed0765d2ca5689513cd0e6ea0806e
parentdafd3eb29e1cf7014fa6a282ea3e2dbdfaa4fc14
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>
drivers/net/ethernet/freescale/fec_main.c