diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/ccree/cc_cipher.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c index 5760ca9481ea..1aa7c56dbc02 100644 --- a/drivers/crypto/ccree/cc_cipher.c +++ b/drivers/crypto/ccree/cc_cipher.c @@ -626,12 +626,11 @@ static int cc_cipher_process(struct skcipher_request *req, /* 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) && |