* [cryptodev:master 9/38] drivers/crypto/ccree/cc_cipher.c:629:15-22: WARNING opportunity for kmemdep
@ 2018-02-15 16:40 kbuild test robot
2018-02-15 16:40 ` [PATCH] crypto: fix memdup.cocci warnings kbuild test robot
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2018-02-15 16:40 UTC (permalink / raw)
To: Gilad Ben-Yossef; +Cc: kbuild-all, linux-crypto, Herbert Xu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head: a43a34845a156c9e1dae00e33595a508d53e0365
commit: 63ee04c8b491ee148489347e7da9fbfd982ca2bb [9/38] crypto: ccree - add skcipher support
coccinelle warnings: (new ones prefixed by >>)
>> drivers/crypto/ccree/cc_cipher.c:629:15-22: WARNING opportunity for kmemdep
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] crypto: fix memdup.cocci warnings
2018-02-15 16:40 [cryptodev:master 9/38] drivers/crypto/ccree/cc_cipher.c:629:15-22: WARNING opportunity for kmemdep kbuild test robot
@ 2018-02-15 16:40 ` kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2018-02-15 16:40 UTC (permalink / raw)
To: Gilad Ben-Yossef; +Cc: kbuild-all, linux-crypto, Herbert Xu
From: Fengguang Wu <fengguang.wu@intel.com>
drivers/crypto/ccree/cc_cipher.c:629:15-22: WARNING opportunity for kmemdep
Use kmemdup rather than duplicating its implementation
Generated by: scripts/coccinelle/api/memdup.cocci
Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support")
CC: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
cc_cipher.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/crypto/ccree/cc_cipher.c
+++ b/drivers/crypto/ccree/cc_cipher.c
@@ -626,12 +626,11 @@ static int cc_cipher_process(struct skci
/* The IV we are handed may be allocted from the stack so
* we must copy it to a DMAable buffer before use.
*/
- req_ctx->iv = kmalloc(ivsize, flags);
+ req_ctx->iv = kmemdup(iv, ivsize, flags);
if (!req_ctx->iv) {
rc = -ENOMEM;
goto exit_process;
}
- memcpy(req_ctx->iv, iv, ivsize);
/*For CTS in case of data size aligned to 16 use CBC mode*/
if (((nbytes % AES_BLOCK_SIZE) == 0) &&
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-15 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-15 16:40 [cryptodev:master 9/38] drivers/crypto/ccree/cc_cipher.c:629:15-22: WARNING opportunity for kmemdep kbuild test robot
2018-02-15 16:40 ` [PATCH] crypto: fix memdup.cocci warnings kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox