From 48ad504ee7d598431cb2d0b2f01c6d1aff1d2a07 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Wed, 6 Dec 2006 20:33:47 -0800 Subject: [PATCH] security/keys/*: user kmemdup() Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Acked-By: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- security/keys/key.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'security/keys/key.c') diff --git a/security/keys/key.c b/security/keys/key.c index 0db816f10f85..ac9326c5f1da 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -290,11 +290,9 @@ struct key *key_alloc(struct key_type *type, const char *desc, goto no_memory_2; if (desc) { - key->description = kmalloc(desclen, GFP_KERNEL); + key->description = kmemdup(desc, desclen, GFP_KERNEL); if (!key->description) goto no_memory_3; - - memcpy(key->description, desc, desclen); } atomic_set(&key->usage, 1); -- cgit v1.2.3