summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorHoria Geanta <horia.geanta@freescale.com>2014-03-14 16:48:30 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2014-03-21 14:54:28 +0100
commitec31eed754e2fd43938e72ef9e1b60aa55ccb417 (patch)
tree11eb75762c4f90357ee7f7f6dbb65f017ccbbd59 /drivers/crypto
parentcrypto: caam - add support for aead null encryption (diff)
downloadlinux-ec31eed754e2fd43938e72ef9e1b60aa55ccb417.tar.xz
linux-ec31eed754e2fd43938e72ef9e1b60aa55ccb417.zip
crypto: caam - add missing key_dma unmap
(struct caam_ctx) ctx->key_dma needs to be unmapped when context is cleaned up. Signed-off-by: Horia Geanta <horia.geanta@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/caam/caamalg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index a9ba8b159636..5f891254db73 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -2380,6 +2380,11 @@ static void caam_cra_exit(struct crypto_tfm *tfm)
dma_unmap_single(ctx->jrdev, ctx->sh_desc_givenc_dma,
desc_bytes(ctx->sh_desc_givenc),
DMA_TO_DEVICE);
+ if (ctx->key_dma &&
+ !dma_mapping_error(ctx->jrdev, ctx->key_dma))
+ dma_unmap_single(ctx->jrdev, ctx->key_dma,
+ ctx->enckeylen + ctx->split_key_pad_len,
+ DMA_TO_DEVICE);
caam_jr_free(ctx->jrdev);
}