aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/talitos.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 54d80e7edb86..f8e2c5c3f4eb 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1416,12 +1416,15 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
1416 /* if its a ahash, add space for a second desc next to the first one */ 1416 /* if its a ahash, add space for a second desc next to the first one */
1417 if (is_sec1 && !dst) 1417 if (is_sec1 && !dst)
1418 alloc_len += sizeof(struct talitos_desc); 1418 alloc_len += sizeof(struct talitos_desc);
1419 alloc_len += ivsize;
1419 1420
1420 edesc = kmalloc(alloc_len, GFP_DMA | flags); 1421 edesc = kmalloc(alloc_len, GFP_DMA | flags);
1421 if (!edesc) 1422 if (!edesc)
1422 return ERR_PTR(-ENOMEM); 1423 return ERR_PTR(-ENOMEM);
1423 if (ivsize) 1424 if (ivsize) {
1425 iv = memcpy(((u8 *)edesc) + alloc_len - ivsize, iv, ivsize);
1424 iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE); 1426 iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
1427 }
1425 memset(&edesc->desc, 0, sizeof(edesc->desc)); 1428 memset(&edesc->desc, 0, sizeof(edesc->desc));
1426 1429
1427 edesc->src_nents = src_nents; 1430 edesc->src_nents = src_nents;