summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-12-03 20:12:30 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-12-05 22:41:41 (GMT)
commitff3516442768f0babe7ea2db62e34aee1d76e969 (patch)
tree23336a0f75b206749b712905cf3198b9867a1fdc
parent2141eaf0e896990ef1042f5bf558935523da69e9 (diff)
downloadlinux-ff3516442768f0babe7ea2db62e34aee1d76e969.tar.xz
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>
-rw-r--r--drivers/net/wan/hdlc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c
index 51f6cee..2a6595b 100644
--- a/drivers/net/wan/hdlc.c
+++ b/drivers/net/wan/hdlc.c
@@ -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();
}