* [Bridge] [PATCH] bridge: fix error handling in br_add_if()
@ 2008-03-18 19:39 Volodymyr G. Lukiianyk
0 siblings, 0 replies; only message in thread
From: Volodymyr G. Lukiianyk @ 2008-03-18 19:39 UTC (permalink / raw)
To: bridge, Stephen Hemminger
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
When device is added to bridge its refcnt is incremented (in new_nbp()), but if
error occurs during further br_add_if() operations this counter is not
decremented back. Fix it by adding dev_put() call in the error path.
Signed-off-by: Volodymyr G Lukiianyk <volodymyrgl@gmail.com>
[-- Attachment #2: br_add_if_put_dev.diff --]
[-- Type: text/x-patch, Size: 339 bytes --]
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 298e0f4..77a981a 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -411,9 +411,12 @@ err2:
br_fdb_delete_by_port(br, p, 1);
err1:
kobject_del(&p->kobj);
- return err;
+ goto put_back;
err0:
kobject_put(&p->kobj);
+
+put_back:
+ dev_put(dev);
return err;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-18 19:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 19:39 [Bridge] [PATCH] bridge: fix error handling in br_add_if() Volodymyr G. Lukiianyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox