[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080428172925.64b88010@extreme>
Date: Mon, 28 Apr 2008 17:29:25 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org,
Volodymyr G Lukiianyk <volodymyrgl@...il.com>
Subject: [PATCH 1/2] bridge: fix error handling in br_add_if()
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@...il.com>
Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
--- a/net/bridge/br_if.c 2008-04-28 15:27:06.000000000 -0700
+++ b/net/bridge/br_if.c 2008-04-28 15:31:18.000000000 -0700
@@ -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;
}
--
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