* [PATCH 2/2][BRIDGE]: Consolidate error paths in br_add_bridge().
@ 2008-05-04 6:49 Pavel Emelyanov
2008-05-05 0:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-05-04 6:49 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List
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@openvz.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2][BRIDGE]: Consolidate error paths in br_add_bridge().
2008-05-04 6:49 [PATCH 2/2][BRIDGE]: Consolidate error paths in br_add_bridge() Pavel Emelyanov
@ 2008-05-05 0:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-05-05 0:58 UTC (permalink / raw)
To: xemul; +Cc: netdev
From: Pavel Emelyanov <xemul@openvz.org>
Date: Sun, 04 May 2008 10:49:21 +0400
> 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@openvz.org>
Looks good, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-05 0:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 6:49 [PATCH 2/2][BRIDGE]: Consolidate error paths in br_add_bridge() Pavel Emelyanov
2008-05-05 0:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).