summaryrefslogtreecommitdiffstats
path: root/net/ceph/crypto.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-10 19:45:21 +0100
committerSage Weil <sage@newdream.net>2012-01-10 08:56:54 -0800
commit186482560f660b8dbf77ee43aa6489cb45d342cd (patch)
tree313156ea6ce1311fba0c569ac0fc51cafaca9d4b /net/ceph/crypto.c
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
downloadop-kernel-dev-186482560f660b8dbf77ee43aa6489cb45d342cd.zip
op-kernel-dev-186482560f660b8dbf77ee43aa6489cb45d342cd.tar.gz
ceph: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph/crypto.c')
-rw-r--r--net/ceph/crypto.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 85f3bc0..b780cb7 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -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;
}
OpenPOWER on IntegriCloud