From: Daniel Lezcano Date: Sun, 22 Feb 2009 08:07:53 +0000 (-0800) Subject: netns: fix double free at netns creation X-Git-Tag: v2.6.29-rc7~70^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=486a87f1e5624096bd1c09e9e716239597d48dca;p=pandora-kernel.git netns: fix double free at netns creation This patch fix a double free when a network namespace fails. The previous code does a kfree of the net_generic structure when one of the init subsystem initialization fails. The 'setup_net' function does kfree(ng) and returns an error. The caller, 'copy_net_ns', call net_free on error, and this one calls kfree(net->gen), making this pointer freed twice. This patch make the code symetric, the net_alloc does the net_generic allocation and the net_free frees the net_generic. Signed-off-by: Daniel Lezcano Signed-off-by: David S. Miller --- Reading git-diff-tree failed