commit | f555b008c576819c27959a45dc418318fcc20a95 | [log] [tgz] |
---|---|---|
author | Peng Fan <[email protected]> | Tue Mar 05 15:49:50 2019 -0800 |
committer | Greg Kroah-Hartman <[email protected]> | Fri Apr 05 22:32:58 2019 +0200 |
tree | 714844b4226d4dacdfca5f8dcde8bb86044805f6 | |
parent | 7b287c47e4524bdc73152d77a68c68a044b9c111 [diff] |
mm/cma.c: cma_declare_contiguous: correct err handling [ Upstream commit 0d3bd18a5efd66097ef58622b898d3139790aa9d ] In case cma_init_reserved_mem failed, need to free the memblock allocated by memblock_reserve or memblock_alloc_range. Quote Catalin's comments: https://lkml.org/lkml/2019/2/26/482 Kmemleak is supposed to work with the memblock_{alloc,free} pair and it ignores the memblock_reserve() as a memblock_alloc() implementation detail. It is, however, tolerant to memblock_free() being called on a sub-range or just a different range from a previous memblock_alloc(). So the original patch looks fine to me. FWIW: Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Reviewed-by: Mike Rapoport <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Marek Szyprowski <[email protected]> Cc: Andrey Konovalov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Sasha Levin <[email protected]>