[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <481D5C71.9000005@openvz.org>
Date: Sun, 04 May 2008 10:49:21 +0400
From: Pavel Emelyanov <xemul@...nvz.org>
To: David Miller <davem@...emloft.net>
CC: Linux Netdev List <netdev@...r.kernel.org>
Subject: [PATCH 2/2][BRIDGE]: Consolidate error paths in br_add_bridge().
This actually had to be merged with the patch #1, but I decided
not to mix two changes in one patch.
There are already two calls to free_netdev() in there, so merge
them into one.
Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
---
net/bridge/br_if.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index bff0f5b..c2397f5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -273,17 +273,13 @@ int br_add_bridge(const char *name)
rtnl_lock();
if (strchr(dev->name, '%')) {
ret = dev_alloc_name(dev, dev->name);
- if (ret < 0) {
- free_netdev(dev);
- goto out;
- }
+ if (ret < 0)
+ goto out_free;
}
ret = register_netdevice(dev);
- if (ret) {
- free_netdev(dev);
- goto out;
- }
+ if (ret)
+ goto out_free;
ret = br_sysfs_addbr(dev);
if (ret)
@@ -291,6 +287,10 @@ int br_add_bridge(const char *name)
out:
rtnl_unlock();
return ret;
+
+out_free:
+ free_netdev(dev);
+ goto out;
}
int br_del_bridge(const char *name)
--
1.5.3.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists