提交 e05d722e 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

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

Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3e2a532b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册