提交 ff351644 编写于 作者: A Andrew Lunn 提交者: David S. Miller

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: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2141eaf0
...@@ -266,8 +266,8 @@ struct net_device *alloc_hdlcdev(void *priv) ...@@ -266,8 +266,8 @@ struct net_device *alloc_hdlcdev(void *priv)
void unregister_hdlc_device(struct net_device *dev) void unregister_hdlc_device(struct net_device *dev)
{ {
rtnl_lock(); rtnl_lock();
unregister_netdevice(dev);
detach_hdlc_protocol(dev); detach_hdlc_protocol(dev);
unregister_netdevice(dev);
rtnl_unlock(); rtnl_unlock();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册