Skip to content

Commit

Permalink
[PATCH] kernel/nsproxy.c: use kmemdup()
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Oct 20, 2006
1 parent 3e2a532 commit e05d722
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/nsproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ static inline struct nsproxy *clone_namespaces(struct nsproxy *orig)
{
struct nsproxy *ns;

ns = kmalloc(sizeof(struct nsproxy), GFP_KERNEL);
if (ns) {
memcpy(ns, orig, sizeof(struct nsproxy));
ns = kmemdup(orig, sizeof(struct nsproxy), GFP_KERNEL);
if (ns)
atomic_set(&ns->count, 1);
}
return ns;
}

Expand Down

0 comments on commit e05d722

Please sign in to comment.