]> git.karo-electronics.de Git - karo-tx-linux.git/commit
usb: gadget: Fix g_ether interface link status
authorKevin Cernekee <cernekee@gmail.com>
Mon, 25 Jun 2012 04:11:22 +0000 (21:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:22:47 +0000 (08:22 -0700)
commit70264a590873e34ee57e3dff9e8962d4516fe6ba
tree1f053d9ed045b19ede4f3e62339da2d118ec634d
parent98b8cee65f67067befa26159b1feeba2251659b5
usb: gadget: Fix g_ether interface link status

commit 31bde1ceaa873bcaecd49e829bfabceacc4c512d upstream.

A "usb0" interface that has never been connected to a host has an unknown
operstate, and therefore the IFF_RUNNING flag is (incorrectly) asserted
when queried by ifconfig, ifplugd, etc.  This is a result of calling
netif_carrier_off() too early in the probe function; it should be called
after register_netdev().

Similar problems have been fixed in many other drivers, e.g.:

    e826eafa6 (bonding: Call netif_carrier_off after register_netdevice)
    0d672e9f8 (drivers/net: Call netif_carrier_off at the end of the probe)
    6a3c869a6 (cxgb4: fix reported state of interfaces without link)

Fix is to move netif_carrier_off() to the end of the function.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/u_ether.c