OSDN Git Service
(root)
/
uclinux-h8
/
linux.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
0b8aab0
..
841acdf
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;
}