We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c56c2e1 commit 1bea445Copy full SHA for 1bea445
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 */
1417
if (is_sec1 && !dst)
1418
alloc_len += sizeof(struct talitos_desc);
1419
+ alloc_len += ivsize;
1420
1421
edesc = kmalloc(alloc_len, GFP_DMA | flags);
1422
if (!edesc)
1423
return ERR_PTR(-ENOMEM);
- if (ivsize)
1424
+ if (ivsize) {
1425
+ iv = memcpy(((u8 *)edesc) + alloc_len - ivsize, iv, ivsize);
1426
iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
1427
+ }
1428
memset(&edesc->desc, 0, sizeof(edesc->desc));
1429
1430
edesc->src_nents = src_nents;
0 commit comments