: Net device leak in br_add_bridge().
Subsystems (3)
PATCH 1/2 : 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 Pavel Emelyanov <[email protected]>
--- net/bridge/br_if.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
net/bridge/br_if.c +3 -1
@@ -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)
From: Pavel Emelyanov <[email protected]>
Date: Sun, 04 May 2008 10:47:29 +0400
Quoted 6 lines
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 Pavel Emelyanov <[email protected]>
Applied.