projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61abc35
)
crypto: ccp - Use kmemdup in ccp_copy_and_save_keypart()
author
YueHaibing
<yuehaibing@huawei.com>
Sat, 30 Mar 2019 01:43:16 +0000
(
01:43
+0000)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Mon, 8 Apr 2019 06:36:16 +0000
(14:36 +0800)
Use kmemdup rather than duplicating its implementation
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-crypto-rsa.c
patch
|
blob
|
history
diff --git
a/drivers/crypto/ccp/ccp-crypto-rsa.c
b/drivers/crypto/ccp/ccp-crypto-rsa.c
index 0b8aab009e7b170393b21b5a1f220bc5d74adaff..841acdffbc3ce1583e07f528529d5f9cbd46ebf4 100644
(file)
--- a/
drivers/crypto/ccp/ccp-crypto-rsa.c
+++ b/
drivers/crypto/ccp/ccp-crypto-rsa.c
@@
-37,10
+37,9
@@
static inline int ccp_copy_and_save_keypart(u8 **kpbuf, unsigned int *kplen,
if (buf[nskip])
break;
*kplen = sz - nskip;
- *kpbuf = k
zalloc(
*kplen, GFP_KERNEL);
+ *kpbuf = k
memdup(buf + nskip,
*kplen, GFP_KERNEL);
if (!*kpbuf)
return -ENOMEM;
- memcpy(*kpbuf, buf + nskip, *kplen);
return 0;
}