Re: + of-fix-kmemleak-crash-caused-by-imbalance-in-early-memory-reservation.patch added to -mm tree

From: Marc Gonzalez
Date: Tue Feb 26 2019 - 05:05:01 EST


On 21/02/2019 12:13, Marek Szyprowski wrote:

> On 2019-02-13 21:13, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
>
>> --- a/drivers/of/of_reserved_mem.c~of-fix-kmemleak-crash-caused-by-imbalance-in-early-memory-reservation
>> +++ a/drivers/of/of_reserved_mem.c
>> @@ -34,22 +34,15 @@ int __init __weak early_init_dt_alloc_re
>>
>> end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end;
>> align = !align ? SMP_CACHE_BYTES : align;
>> - base = memblock_phys_alloc_range(size, align, 0, end);
>> + base = memblock_find_in_range(size, align, start, end);
>
> The parameters for memblock_find_in_range() are not in the correct
> order. The proper call should be:
>
> memblock_find_in_range(start, end, size, align)

How is it possible that calling memblock_find_in_range() with incorrect parameters
"fixed" the crash? o_O

Regards.