Skip to content

Commit

Permalink
[PATCH] nsproxy cloning error path fix
Browse files Browse the repository at this point in the history
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 <xemul@openvz.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Pavel authored and Linus Torvalds committed Oct 2, 2006
1 parent fcfbd54 commit 5d124e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/nsproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int copy_namespaces(int flags, struct task_struct *tsk)
put_namespace(new_ns->namespace);
out_ns:
tsk->nsproxy = old_ns;
put_nsproxy(new_ns);
kfree(new_ns);
goto out;
}

Expand Down

0 comments on commit 5d124e9

Please sign in to comment.