|
@@ -15,10 +15,9 @@ int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
|
|
|
const struct ceph_crypto_key *src)
|
|
|
{
|
|
|
memcpy(dst, src, sizeof(struct ceph_crypto_key));
|
|
|
- dst->key = kmalloc(src->len, GFP_NOFS);
|
|
|
+ dst->key = kmemdup(src->key, src->len, GFP_NOFS);
|
|
|
if (!dst->key)
|
|
|
return -ENOMEM;
|
|
|
- memcpy(dst->key, src->key, src->len);
|
|
|
return 0;
|
|
|
}
|
|
|
|