dma-debug: fix memory leak in debug_dma_alloc_coherent
Marty reported a memory leakage introduced by commit 3aaabbf1 ("lib/dma-debug.c: fix incorrect pfn calculation"). Fix it by checking the virtual address before allocating the entry. This patch also use virt_addr_valid() instead of virt_to_page() to check if a virtual address is linear. Fixes: 3aaabbf1 ("lib/dma-debug.c: fix incorrect pfn calculation") Reported-by: NMarty Faltesek <mfaltesek@google.com> Signed-off-by: NMiles Chen <miles.chen@mediatek.com> Acked-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NChristoph Hellwig <hch@lst.de>
Showing
想要评论请 注册 或 登录