diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2014-03-14 11:48:30 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-03-21 09:54:28 -0400 |
commit | ec31eed754e2fd43938e72ef9e1b60aa55ccb417 (patch) | |
tree | 11eb75762c4f90357ee7f7f6dbb65f017ccbbd59 | |
parent | ae4a825ffdd6fd769af2667e03070940af1b8368 (diff) |
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>
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 5 |
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) | |||
2380 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_givenc_dma, | 2380 | dma_unmap_single(ctx->jrdev, ctx->sh_desc_givenc_dma, |
2381 | desc_bytes(ctx->sh_desc_givenc), | 2381 | desc_bytes(ctx->sh_desc_givenc), |
2382 | DMA_TO_DEVICE); | 2382 | DMA_TO_DEVICE); |
2383 | if (ctx->key_dma && | ||
2384 | !dma_mapping_error(ctx->jrdev, ctx->key_dma)) | ||
2385 | dma_unmap_single(ctx->jrdev, ctx->key_dma, | ||
2386 | ctx->enckeylen + ctx->split_key_pad_len, | ||
2387 | DMA_TO_DEVICE); | ||
2383 | 2388 | ||
2384 | caam_jr_free(ctx->jrdev); | 2389 | caam_jr_free(ctx->jrdev); |
2385 | } | 2390 | } |