From d072c408abe1da1b31ded184860fcf51ed49de35 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 21 Sep 2021 14:15:05 +0200 Subject: [PATCH] dde_linux: call init_page_count for each page The lx_emul_virt_to_pages implementation initialized the page ref counter only for the first page, leaving the remaining elements in uninitialized state. This, in turn, rendered the Linux page_pool (as used by the emac network driver) ineffective, ultimately leading the a memory leak. The fix changes the call of 'init_page_count' to take the loop variable as argument. Issue #4225 --- repos/dde_linux/src/lib/lx_emul/virt_to_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/dde_linux/src/lib/lx_emul/virt_to_page.c b/repos/dde_linux/src/lib/lx_emul/virt_to_page.c index 2827795739..65d26cdc73 100644 --- a/repos/dde_linux/src/lib/lx_emul/virt_to_page.c +++ b/repos/dde_linux/src/lib/lx_emul/virt_to_page.c @@ -29,7 +29,7 @@ struct page *lx_emul_virt_to_pages(void const *virt, unsigned count) page = p; for (i = 0; i < count; i++, p++) { p->virtual = (void*)((uintptr_t)page_aligned_virt + i*PAGE_SIZE); - init_page_count(page); + init_page_count(p); lx_emul_associate_page_with_virt_addr(p, p->virtual); }