]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] kernel/nsproxy.c: use kmemdup()
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 20 Oct 2006 06:29:12 +0000 (23:29 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 20 Oct 2006 17:26:44 +0000 (10:26 -0700)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/nsproxy.c

index 6ebdb82a0ce43a5211e3862008959cb5091febcd..674aceb7335ad56f7a2a8ba2996d0faa4ed850db 100644 (file)
@@ -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;
 }