Skip to contentSkip to conversation

Lost call to br_fdb_fini() in br_init() error path

PATCH In review Pavel Emelyanov 3 participants 3 messages Nov 27, 2007 – Nov 29, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Lost call to br_fdb_fini() in br_init() error path

In case the br_netfilter_init() (or any subsequent call) fails, the br_fdb_fini() must be called to free the allocated in br_fdb_init() br_fdb_cache kmem cache.

---

net/bridge/br.c +3 -1
index 93867bb..a901828 100644
@@ -39,7 +39,7 @@ static int __init br_init(void)
 
 	err = br_fdb_init();
 	if (err)
-		goto err_out1;
+		goto err_out;
 
 	err = br_netfilter_init();
 	if (err)
@@ -65,6 +65,8 @@ err_out3:
 err_out2:
 	br_netfilter_fini();
 err_out1:
+	br_fdb_fini();
+err_out:
 	llc_sap_put(br_stp_sap);
 	return err;
 }
#1 lore raw
Quoted 22 lines · On Tue, 27 Nov 2007 17:39:42 +0300 Pavel Emelyanov <[email protected]> wrote:

In case the br_netfilter_init() (or any subsequent call) fails, the br_fdb_fini() must be called to free the allocated in br_fdb_init() br_fdb_cache kmem cache.

---

net/bridge/br.c +1 -1
index 93867bb..a901828 100644
@@ -39,7 +39,7 @@ static int __init br_init(void)
 
 	err = br_fdb_init();
 	if (err)
-		goto err_out1;
+		goto err_out;
 
 	err = br_netfilter_init();
 	if (err)

net/bridge/br.c err_out3: · line 72

Quoted 8 lines
net/bridge/br.c +2 -0
@@ -65,6 +65,8 @@ err_out3:
 err_out2:
 	br_netfilter_fini();
 err_out1:
+	br_fdb_fini();
+err_out:
 	llc_sap_put(br_stp_sap);
 	return err;
 }

Good catch, thanks I hope you didn't find this in live system.

Signature · 1 line
Stephen Hemminger <[email protected]>
#2 lore raw
In reply to Pavel Emelyanov
Quoted 5 lines · Pavel Emelyanov

In case the br_netfilter_init() (or any subsequent call) fails, the br_fdb_fini() must be called to free the allocated in br_fdb_init() br_fdb_cache kmem cache.

Patch applied to net-2.6. Thanks Pavel!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt