All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/arm/mm/dma-mapping.c: fix __alloc_from_pool returning a dirty buffer
@ 2022-12-23 14:15 Igor Klochko
  2022-12-23 14:39 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Igor Klochko @ 2022-12-23 14:15 UTC (permalink / raw)
  To: hch; +Cc: iommu, robin.murphy, m.szyprowski


Hi, 

A small patch for __alloc_from_pool to clean the buffer before returning.
 
---
 arch/arm/mm/dma-mapping.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index c135f6e37a00..bb2bb3ab497a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -366,6 +366,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
 
 		*ret_page = phys_to_page(phys);
 		ptr = (void *)val;
+		memset(ptr, 0, size);
 	}
 
 	return ptr;
-- 
2.39.0


Kind regards,
Igor Klochko

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-03 16:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 14:15 [PATCH] arch/arm/mm/dma-mapping.c: fix __alloc_from_pool returning a dirty buffer Igor Klochko
2022-12-23 14:39 ` Christoph Hellwig
2022-12-23 22:51   ` Igor Klochko
2022-12-23 22:51     ` Igor Klochko
2023-01-03  9:51     ` Russell King (Oracle)
2023-01-03  9:51       ` Russell King (Oracle)
2023-01-03 13:58       ` Robin Murphy
2023-01-03 13:58         ` Robin Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.