On Wed, 26 Aug 2020 17:13:12 +0100 Joao Martins <joao.m.martins@xxxxxxxxxx> wrote: > This should have been: Thanks. > > And also the MEMORY_HOTPLUG=n and ACPI=n build issues that Randy/you fixed which are > introduced by this series too. Just to confirm: I should add up all these fixes and respin > the series right? Or should I follow-up the first one on top of what you've already staged > in -mm tree? That's OK, I've been scooping up the fixes. https://ozlabs.org/~akpm/mmots/broken-out/mm-memory_hotplug-introduce-default-phys_to_target_node-implementation-fix.patch https://ozlabs.org/~akpm/mmots/broken-out/device-dax-make-align-a-per-device-property-fix.patch and this one, From: Joao Martins <joao.m.martins@xxxxxxxxxx> Subject: device-dax-add-dis-contiguous-resource-support-fix kfree only with nr_range == 0, while also avoiding the leakage of @ranges (from krealloc success case with nr_ranges > 0) without the null deref that this introduces. Link: https://lkml.kernel.org/r/6d57acf7-63cf-168d-f68e-67d88832f10f@xxxxxxxxxx Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Vishal Verma <vishal.l.verma@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/dax/bus.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/dax/bus.c~device-dax-add-dis-contiguous-resource-support-fix +++ a/drivers/dax/bus.c @@ -607,13 +607,16 @@ static int alloc_dev_dax_range(struct de return -ENOMEM; alloc = __request_region(res, start, size, dev_name(dev), 0); - if (!alloc && !dev_dax->nr_range) { + if (!alloc) { /* - * If we adjusted an existing @ranges leave it alone, - * but if this was an empty set of ranges nothing else + * If this was an empty set of ranges nothing else * will release @ranges, so do it now. */ - kfree(ranges); + if (!dev_dax->nr_range) { + kfree(ranges); + ranges = NULL; + } + dev_dax->ranges = ranges; return -ENOMEM; } _