Messages in this thread Patch in this message | | | Date | Thu, 19 Oct 2006 22:16:49 +0400 | From | Alexey Dobriyan <> | Subject | [PATCH] kernel/nsproxy.c: use kmemdup() |
| |
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> ---
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |