aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/omap-aes.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index e5b2120a12b9..1cad12ef4f55 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -165,6 +165,8 @@ struct omap_aes_dev {
165 void *buf_out; 165 void *buf_out;
166 int dma_out; 166 int dma_out;
167 struct dma_chan *dma_lch_out; 167 struct dma_chan *dma_lch_out;
168 int in_sg_len;
169 int out_sg_len;
168 dma_addr_t dma_addr_out; 170 dma_addr_t dma_addr_out;
169 171
170 const struct omap_aes_pdata *pdata; 172 const struct omap_aes_pdata *pdata;
@@ -725,6 +727,10 @@ static int omap_aes_handle_queue(struct omap_aes_dev *dd,
725 dd->out_offset = 0; 727 dd->out_offset = 0;
726 dd->out_sg = req->dst; 728 dd->out_sg = req->dst;
727 729
730 dd->in_sg_len = scatterwalk_bytes_sglen(dd->in_sg, dd->total);
731 dd->out_sg_len = scatterwalk_bytes_sglen(dd->out_sg, dd->total);
732 BUG_ON(dd->in_sg_len < 0 || dd->out_sg_len < 0);
733
728 rctx = ablkcipher_request_ctx(req); 734 rctx = ablkcipher_request_ctx(req);
729 ctx = crypto_ablkcipher_ctx(crypto_ablkcipher_reqtfm(req)); 735 ctx = crypto_ablkcipher_ctx(crypto_ablkcipher_reqtfm(req));
730 rctx->mode &= FLAGS_MODE_MASK; 736 rctx->mode &= FLAGS_MODE_MASK;