Skip to content

Commit

Permalink
ipcns: remove useless get/put while CLONE_NEWIPC
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Reviewed-by: WANG Cong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed Jun 18, 2009
1 parent 4c2a7e7 commit 6442428
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ipc/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6442428

Please sign in to comment.