mm/memory-failure.c: don't access uninitialized memmaps in memory_failure()
authorDavid Hildenbrand <david@redhat.com>
Sat, 19 Oct 2019 03:19:23 +0000 (20:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Oct 2019 08:19:57 +0000 (09:19 +0100)
commit9792afbd630bd4a558f90454438dfc5e45e20ef0
tree22388384444ea4a63ce05d2fb1c295d0b1389cf3
parent01a44055a48aaf802382c27d96150bfe5630904d
mm/memory-failure.c: don't access uninitialized memmaps in memory_failure()

commit 96c804a6ae8c59a9092b3d5dd581198472063184 upstream.

We should check for pfn_to_online_page() to not access uninitialized
memmaps.  Reshuffle the code so we don't have to duplicate the error
message.

Link: http://lkml.kernel.org/r/20191009142435.3975-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Fixes: f1dd2cd13c4b ("mm, memory_hotplug: do not associate hotadded memory to zones until online") [visible after d0dc12e86b319]
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: <stable@vger.kernel.org> [4.13+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/memory-failure.c