[PATCH] kmemdup: some users
[linux-2.6.git] / fs / posix_acl.c
index 6c8dcf7613fd89bf903a95b311af8a1eee2bf8ce..aec931e09973716240bf55441622dccf95cf3c74 100644 (file)
@@ -58,11 +58,9 @@ posix_acl_clone(const struct posix_acl *acl, gfp_t flags)
        if (acl) {
                int size = sizeof(struct posix_acl) + acl->a_count *
                           sizeof(struct posix_acl_entry);
-               clone = kmalloc(size, flags);
-               if (clone) {
-                       memcpy(clone, acl, size);
+               clone = kmemdup(acl, size, flags);
+               if (clone)
                        atomic_set(&clone->a_refcount, 1);
-               }
        }
        return clone;
 }