Commit e05d722e authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

[PATCH] kernel/nsproxy.c: use kmemdup()

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3e2a532b
...@@ -44,11 +44,9 @@ static inline struct nsproxy *clone_namespaces(struct nsproxy *orig) ...@@ -44,11 +44,9 @@ static inline struct nsproxy *clone_namespaces(struct nsproxy *orig)
{ {
struct nsproxy *ns; struct nsproxy *ns;
ns = kmalloc(sizeof(struct nsproxy), GFP_KERNEL); ns = kmemdup(orig, sizeof(struct nsproxy), GFP_KERNEL);
if (ns) { if (ns)
memcpy(ns, orig, sizeof(struct nsproxy));
atomic_set(&ns->count, 1); atomic_set(&ns->count, 1);
}
return ns; return ns;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment