diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-10-20 02:29:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:44 -0400 |
commit | e05d722e4555cd54677b4c8431d9e81fd047ef7a (patch) | |
tree | d07d2ede9c29f9ef7b06d34dee6729117e0224ec /kernel | |
parent | 3e2a532b26b491706bd8b5c7cfc8d767b43b8f36 (diff) |
[PATCH] kernel/nsproxy.c: use kmemdup()
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/nsproxy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c index 6ebdb82a0ce4..674aceb7335a 100644 --- a/kernel/nsproxy.c +++ b/kernel/nsproxy.c | |||
@@ -44,11 +44,9 @@ static inline struct nsproxy *clone_namespaces(struct nsproxy *orig) | |||
44 | { | 44 | { |
45 | struct nsproxy *ns; | 45 | struct nsproxy *ns; |
46 | 46 | ||
47 | ns = kmalloc(sizeof(struct nsproxy), GFP_KERNEL); | 47 | ns = kmemdup(orig, sizeof(struct nsproxy), GFP_KERNEL); |
48 | if (ns) { | 48 | if (ns) |
49 | memcpy(ns, orig, sizeof(struct nsproxy)); | ||
50 | atomic_set(&ns->count, 1); | 49 | atomic_set(&ns->count, 1); |
51 | } | ||
52 | return ns; | 50 | return ns; |
53 | } | 51 | } |
54 | 52 | ||