Message ID | 20201123102133.18979-1-saiprakash.ranjan@codeaurora.org |
---|---|
State | New |
Headers | show |
Series | coresight: tmc-etr: Check if page is valid before dma_map_page() | expand |
Hello: This patch was applied to qcom/linux.git (refs/heads/for-next): On Mon, 23 Nov 2020 15:51:33 +0530 you wrote: > From: Mao Jinlong <jinlmao@codeaurora.org> > > alloc_pages_node() return should be checked before calling > dma_map_page() to make sure that valid page is mapped or > else it can lead to aborts as below: > > Unable to handle kernel paging request at virtual address ffffffc008000000 > Mem abort info: > <snip>... > pc : __dma_inv_area+0x40/0x58 > lr : dma_direct_map_page+0xd8/0x1c8 > > [...] Here is the summary with links: - coresight: tmc-etr: Check if page is valid before dma_map_page() https://git.kernel.org/qcom/c/1cc573d5754e You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 525f0ecc129c..a31a4d7ae25e 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -217,6 +217,8 @@ static int tmc_pages_alloc(struct tmc_pages *tmc_pages, } else { page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); + if (!page) + goto err; } paddr = dma_map_page(real_dev, page, 0, PAGE_SIZE, dir); if (dma_mapping_error(real_dev, paddr))