crypto: caam - fix DMA mapping xcbc key twice
authorHoria Geantă <horia.geanta@nxp.com>
Tue, 19 Feb 2019 14:56:56 +0000 (16:56 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 Feb 2019 06:17:58 +0000 (14:17 +0800)
Fix a side effect of adding xcbc support, which leads to DMA mapping the
key twice.

Fixes: 12b8567f6fa4 ("crypto: caam - add support for xcbc(aes)")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamhash.c

index 2c5aca59229b1fa19acba9949c74f5d1d8a6f527..a71408f366548cea9060cbf8486d6d461ec90692 100644 (file)
@@ -1897,8 +1897,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
        }
 
        dma_addr = dma_map_single_attrs(ctx->jrdev, ctx->sh_desc_update,
-                                       offsetof(struct caam_hash_ctx,
-                                                sh_desc_update_dma),
+                                       offsetof(struct caam_hash_ctx, key),
                                        ctx->dir, DMA_ATTR_SKIP_CPU_SYNC);
        if (dma_mapping_error(ctx->jrdev, dma_addr)) {
                dev_err(ctx->jrdev, "unable to map shared descriptors\n");