Skip to content

Commit

Permalink
USB: gadget: fix ethernet gadget crash in gether_setup
Browse files Browse the repository at this point in the history
Crash is triggered by commit e648493 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.

Signed-off-by: Dmitry Artamonow <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dja-dja-mad authored and davem330 committed Oct 28, 2010
1 parent 4aa2c46 commit 349f6c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
* - iff DATA transfer is active, carrier is "on"
* - tx queueing enabled if open *and* carrier is "on"
*/
netif_stop_queue(net);
netif_carrier_off(net);

dev->gadget = g;
Expand All @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
INFO(dev, "MAC %pM\n", net->dev_addr);
INFO(dev, "HOST MAC %pM\n", dev->host_mac);

netif_stop_queue(net);
the_dev = dev;
}

Expand Down

0 comments on commit 349f6c5

Please sign in to comment.