summaryrefslogtreecommitdiff
blob: 755bd4ed67e8b12ce7d99dc9cbce04fc916b785d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Pavel Emelyanov <xemul@openvz.org>
Date: Wed, 22 Apr 2009 15:05:03 +0000 (+0400)
Subject: net: avoid double free on net->gen pointer on error
X-Git-Url: http://git.openvz.org/?p=linux-2.6.27-openvz;a=commitdiff_plain;h=4f908925f495ea1e2f401b8fcf3cdc91c5968429

net: avoid double free on net->gen pointer on error

If we failed with netns creation net->gen will be kfree-ed twice.

http://bugzilla.openvz.org/show_bug.cgi?id=1241

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 523eba0..64b0a40 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -75,6 +75,7 @@ out_undo:
 	}
 
 	rcu_barrier();
+	net->gen = NULL;
 	kfree(ng);
 	goto out;
 }