Skip to content

Commit

Permalink
WAN: HDLC: Detach protocol before unregistering device
Browse files Browse the repository at this point in the history
The current code first unregisters the device, and then detaches the
protocol from it. This should be performed the other way around, since
the detach may try to use state which has been freed by the
unregister. Swap the order, so that we first detach and then remove the
netdev.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Dec 5, 2015
1 parent 2141eaf commit ff35164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wan/hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ struct net_device *alloc_hdlcdev(void *priv)
void unregister_hdlc_device(struct net_device *dev)
{
rtnl_lock();
unregister_netdevice(dev);
detach_hdlc_protocol(dev);
unregister_netdevice(dev);
rtnl_unlock();
}

Expand Down

0 comments on commit ff35164

Please sign in to comment.