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

From: Alexey Dobriyan
Date: Thu Oct 19 2006 - 14:17:22 EST


Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

kernel/nsproxy.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -44,11 +44,9 @@ static inline struct nsproxy *clone_name
{
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;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/