ipcns: remove useless get/put while CLONE_NEWIPC
[safe/jmp/linux-2.6] / ipc / namespace.c
index 4a5e752..a56fc59 100644 (file)
@@ -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;
 }