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

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

bridge: Net device leak in br_add_bridge().



In case the register_netdevice() call fails the device is leaked,
since the out: label is just rtnl_unlock()+return.

Free the device.

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be0c007a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -280,8 +280,10 @@ int br_add_bridge(const char *name)
	}

	ret = register_netdevice(dev);
	if (ret)
	if (ret) {
		free_netdev(dev);
		goto out;
	}

	ret = br_sysfs_addbr(dev);
	if (ret)