On Tue, Feb 19, 2019 at 03:45:00PM +0800, pierre Kuo wrote: > The __reserved_mem_init_node will call region specific reserved memory > init codes, but once all compatibled init codes failed, the memory region > will left in memory.reserved and cause leakage. > > Take cma reserve memory DTS for example, if user declare 1MB size, > which is not align to (PAGE_SIZE << max(MAX_ORDER - 1, > pageblock_order)), rmem_cma_setup will return -EINVAL. > Meanwhile, rmem_dma_setup will also return -EINVAL since "reusable" > property is not set. If finally there is no reserved memory init pick up > this memory, kernel will left the 1MB leak in memory.reserved. > > This patch will remove this kind of memory from memory.reserved, only > when __reserved_mem_init_node return neither 0 nor -ENOENT. > > Signed-off-by: pierre Kuo <vichy.kuo@xxxxxxxxx> > --- > drivers/of/of_reserved_mem.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) As no one else seems to have any comments, I've applied it. Rob