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

Commit 9b772652 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c1e87ed
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3893,7 +3893,6 @@ 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);

	/* And unlink it from device chain. */
@@ -4018,7 +4017,6 @@ 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);

	/* And unlink it from device chain */