提交 9b772652 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NET]: Remove double dev->flags checking when calling dev_close()

The unregister_netdevice() and dev_change_net_namespace()
both check for dev->flags to be IFF_UP before calling the
dev_close(), but the dev_close() checks for IFF_UP itself,
so remove those unneeded checks.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1c1e87ed
......@@ -3893,8 +3893,7 @@ void unregister_netdevice(struct net_device *dev)
BUG_ON(dev->reg_state != NETREG_REGISTERED);
/* If device is running, close it first. */
if (dev->flags & IFF_UP)
dev_close(dev);
dev_close(dev);
/* And unlink it from device chain. */
unlist_netdevice(dev);
......@@ -4018,8 +4017,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
*/
/* If device is running close it first. */
if (dev->flags & IFF_UP)
dev_close(dev);
dev_close(dev);
/* And unlink it from device chain */
err = -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册