Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff351644 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2141eaf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
}