aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-06-17 19:27:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:03:55 -0400
commit64424289dd2e37b4800df1f7f2ef4fe550f58729 (patch)
tree15e33fc3c1e46e423b964998785ba45927e1d83b
parent4c2a7e72d5937c6a112141c7ff3df0727b3cf3df (diff)
ipcns: remove useless get/put while CLONE_NEWIPC
copy_ipcs() doesn't actually copy anything. If new ipcns is created, it's created from scratch, in this case get/put on old ipcns isn't needed. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--ipc/namespace.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index 4a5e752a9276..a56fc598a807 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -50,15 +50,11 @@ struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns)
50{ 50{
51 struct ipc_namespace *new_ns; 51 struct ipc_namespace *new_ns;
52 52
53 BUG_ON(!ns);
54 get_ipc_ns(ns);
55
56 if (!(flags & CLONE_NEWIPC)) 53 if (!(flags & CLONE_NEWIPC))
57 return ns; 54 return get_ipc_ns(ns);
58 55
59 new_ns = clone_ipc_ns(ns); 56 new_ns = clone_ipc_ns(ns);
60 57
61 put_ipc_ns(ns);
62 return new_ns; 58 return new_ns;
63} 59}
64 60