diff options
| author | Marek Szyprowski <m.szyprowski@samsung.com> | 2026-10-26 10:54:15 +0100 |
|---|---|---|
| committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2026-11-05 08:56:32 +0100 |
| commit | ca010d38da7bf05a4572a54c2c16d6d64a758c3a (patch) | |
| tree | f3eb038d81519065d68e58eff9a4ee2f9a062aaf /kernel/debug | |
| parent | 7ad92b81b415de806957b19828fc4777a9cf2216 (diff) | |
dma-pool: release CMA pages on atomic_pool_expand() error path
atomic_pool_expand() may allocate the pool backing pages from CMA via
dma_alloc_from_contiguous(), but the error path unconditionally frees
them with __free_pages(). This hands CMA pages to the buddy allocator
while leaving them marked as allocated in the CMA bitmap, permanently
leaking CMA capacity on every failed expansion.
Try dma_release_from_contiguous() first and fall back to __free_pages()
only for pages that did not come from CMA, as the code did before CMA
allocation was temporarily removed from the pool.
Fixes: d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone")
Closes: https://sashiko.dev/#/bug/linux-fdfc6e83-15e4-4980-9818-691b034397e7
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20261026095423.966856-5-m.szyprowski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'kernel/debug')
0 files changed, 0 insertions, 0 deletions
