Commit bcdda430 authored by Herbert Xu's avatar Herbert Xu

crypto: crypto4xx - Call dma_unmap_page when done

In crypto4xx_cipher_done, we should be unmapping the dst page, not
mapping it.

This was flagged by a sparse warning about the unused addr variable.
While we're at it, also fix a sparse warning regarding the unused
ctx variable in crypto4xx_ahash_done (by actually using it).

Fixes: 049359d6 ("crypto: amcc - Add crypt4xx driver")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Tested-by: default avatarChristian Lamparter <chunkeey@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 72bc4e71
...@@ -522,7 +522,6 @@ static void crypto4xx_cipher_done(struct crypto4xx_device *dev, ...@@ -522,7 +522,6 @@ static void crypto4xx_cipher_done(struct crypto4xx_device *dev,
{ {
struct skcipher_request *req; struct skcipher_request *req;
struct scatterlist *dst; struct scatterlist *dst;
dma_addr_t addr;
req = skcipher_request_cast(pd_uinfo->async_req); req = skcipher_request_cast(pd_uinfo->async_req);
...@@ -531,8 +530,8 @@ static void crypto4xx_cipher_done(struct crypto4xx_device *dev, ...@@ -531,8 +530,8 @@ static void crypto4xx_cipher_done(struct crypto4xx_device *dev,
req->cryptlen, req->dst); req->cryptlen, req->dst);
} else { } else {
dst = pd_uinfo->dest_va; dst = pd_uinfo->dest_va;
addr = dma_map_page(dev->core_dev->device, sg_page(dst), dma_unmap_page(dev->core_dev->device, pd->dest, dst->length,
dst->offset, dst->length, DMA_FROM_DEVICE); DMA_FROM_DEVICE);
} }
if (pd_uinfo->sa_va->sa_command_0.bf.save_iv == SA_SAVE_IV) { if (pd_uinfo->sa_va->sa_command_0.bf.save_iv == SA_SAVE_IV) {
...@@ -557,10 +556,9 @@ static void crypto4xx_ahash_done(struct crypto4xx_device *dev, ...@@ -557,10 +556,9 @@ static void crypto4xx_ahash_done(struct crypto4xx_device *dev,
struct ahash_request *ahash_req; struct ahash_request *ahash_req;
ahash_req = ahash_request_cast(pd_uinfo->async_req); ahash_req = ahash_request_cast(pd_uinfo->async_req);
ctx = crypto_tfm_ctx(ahash_req->base.tfm); ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(ahash_req));
crypto4xx_copy_digest_to_dst(ahash_req->result, pd_uinfo, crypto4xx_copy_digest_to_dst(ahash_req->result, pd_uinfo, ctx);
crypto_tfm_ctx(ahash_req->base.tfm));
crypto4xx_ret_sg_desc(dev, pd_uinfo); crypto4xx_ret_sg_desc(dev, pd_uinfo);
if (pd_uinfo->state & PD_ENTRY_BUSY) if (pd_uinfo->state & PD_ENTRY_BUSY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment