From: Herbert Xu Date: Fri, 30 Dec 2022 07:31:33 +0000 (+0800) Subject: crypto: talitos - Remove GFP_DMA and add DMA alignment padding X-Git-Tag: v6.3-rc1~163^2~136 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e613cec25196b51601dfac50c5bf229acd72bc6;p=thirdparty%2Fkernel%2Flinux.git crypto: talitos - Remove GFP_DMA and add DMA alignment padding GFP_DMA does not guarantee that the returned memory is aligned for DMA. It should be removed where it is superfluous. However, kmalloc may start returning DMA-unaligned memory in future so fix this by adding the alignment by hand. Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 71db6450b6aa4..d62ec68e3183e 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1393,7 +1393,7 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, alloc_len += sizeof(struct talitos_desc); alloc_len += ivsize; - edesc = kmalloc(alloc_len, GFP_DMA | flags); + edesc = kmalloc(ALIGN(alloc_len, dma_get_cache_alignment()), flags); if (!edesc) return ERR_PTR(-ENOMEM); if (ivsize) {