summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam/caamalg.c
diff options
context:
space:
mode:
authorHoria Geanta <horia.geanta@freescale.com>2014-03-05 09:49:33 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-03-31 19:12:59 (GMT)
commit7d49cd7e83e049480f46368b46474d3e7922567c (patch)
treee576740adce2ef4b5c8581ad33f3b602385f4fda /drivers/crypto/caam/caamalg.c
parent6bcf17dc13cfe76b897206cd52251e3d19b6cfab (diff)
downloadlinux-fsl-qoriq-7d49cd7e83e049480f46368b46474d3e7922567c.tar.xz
crypto: caam - add missing key_dma unmap
(struct caam_ctx) ctx->key_dma needs to be unmapped when context is cleaned up. Change-Id: I547568ab769a88241970950dad56666b4acf5516 Signed-off-by: Horia Geanta <horia.geanta@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/10487 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Tudor-Dan Ambarus <tudor.ambarus@freescale.com> Reviewed-by: Alexandru Porosanu <alexandru.porosanu@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/crypto/caam/caamalg.c')
-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 a319c3d..277161de 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -2825,6 +2825,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);
}