From: Pavel Date: Mon, 2 Oct 2006 09:18:24 +0000 (-0700) Subject: [PATCH] nsproxy cloning error path fix X-Git-Tag: MMI-PSA29.97-13-9~46767 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d124e99c2fee1c8f3020ecb0dff8d5617ee7991;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] nsproxy cloning error path fix This patch fixes copy_namespaces()'s error path. when new nsproxy (new_ns) is created pointers to namespaces (ipc, uts) are copied from the old nsproxy. Later in copy_utsname, copy_ipcs, etc. according namespaces are get-ed. On error path needed namespaces are put-ed, so there's no need to put new nsproxy itelf as it woud cause putting namespaces for the second time. Found when incorporating namespaces into OpenVZ kernel. Signed-off-by: Pavel Emelianov Acked-by: Serge Hallyn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c index 8d6c852dc51e..6ebdb82a0ce4 100644 --- a/kernel/nsproxy.c +++ b/kernel/nsproxy.c @@ -123,7 +123,7 @@ out_uts: put_namespace(new_ns->namespace); out_ns: tsk->nsproxy = old_ns; - put_nsproxy(new_ns); + kfree(new_ns); goto out; }