mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
WAN: HDLC: Detach protocol before unregistering device
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>
This commit is contained in:
parent
2141eaf0e8
commit
ff35164427
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue