From: Alexey Dobriyan Date: Wed, 17 Jun 2009 23:27:54 +0000 (-0700) Subject: ipcns: remove useless get/put while CLONE_NEWIPC X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64424289dd2e37b4800df1f7f2ef4fe550f58729;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Acked-by: Serge Hallyn Reviewed-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) { struct ipc_namespace *new_ns; - BUG_ON(!ns); - get_ipc_ns(ns); - if (!(flags & CLONE_NEWIPC)) - return ns; + return get_ipc_ns(ns); new_ns = clone_ipc_ns(ns); - put_ipc_ns(ns); return new_ns; }