diff options
author | Wei Yang <richardw.yang@linux.intel.com> | 2019-09-24 00:35:52 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-25 00:54:09 +0200 |
commit | 33fce0113da2f8a5c1bbce0c46a8b131500f1677 (patch) | |
tree | dff6b88fa98c4478dc2480f64c1764838d9ada14 /kernel/resource.c | |
parent | drivers/base/memory.c: don't store end_section_nr in memory blocks (diff) | |
download | linux-33fce0113da2f8a5c1bbce0c46a8b131500f1677.tar.xz linux-33fce0113da2f8a5c1bbce0c46a8b131500f1677.zip |
mm/memory_hotplug.c: prevent memory leak when reusing pgdat
When offlining a node in try_offline_node(), pgdat is not released. So
that pgdat could be reused in hotadd_new_pgdat(). While we reallocate
pgdat->per_cpu_nodestats if this pgdat is reused.
This patch prevents the memory leak by just allocating per_cpu_nodestats
when it is a new pgdat.
Link: http://lkml.kernel.org/r/20190813020608.10194-1-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <OSalvador@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/resource.c')
0 files changed, 0 insertions, 0 deletions