]> err.no Git - linux-2.6/blobdiff - security/keys/keyring.c
[PATCH] make 1-bit bitfields unsigned
[linux-2.6] / security / keys / keyring.c
index e8d02acc51e7180f23a31b849ccce820418fd55c..ad45ce73964b193db630606c2d302dd6414f57c9 100644 (file)
@@ -706,12 +706,10 @@ int __key_link(struct key *keyring, struct key *key)
                                BUG_ON(size > PAGE_SIZE);
 
                                ret = -ENOMEM;
-                               nklist = kmalloc(size, GFP_KERNEL);
+                               nklist = kmemdup(klist, size, GFP_KERNEL);
                                if (!nklist)
                                        goto error2;
 
-                               memcpy(nklist, klist, size);
-
                                /* replace matched key */
                                atomic_inc(&key->usage);
                                nklist->keys[loop] = key;