PM: hibernate: Use __get_safe_page() rather than touching the list
authorBrian Geffon <bgeffon@google.com>
Thu, 21 Sep 2023 17:00:45 +0000 (13:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:11 +0000 (17:07 +0000)
commit567c6f64950ecbb9cde6f90bc5b785fb502f7e74
tree577408b0ce67f0e1002e09d274082588290837f2
parent2c9222b7dc58e85656fb3f169b263605b59b4779
PM: hibernate: Use __get_safe_page() rather than touching the list

commit f0c7183008b41e92fa676406d87f18773724b48b upstream.

We found at least one situation where the safe pages list was empty and
get_buffer() would gladly try to use a NULL pointer.

Signed-off-by: Brian Geffon <bgeffon@google.com>
Fixes: 8357376d3df2 ("[PATCH] swsusp: Improve handling of highmem")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/power/snapshot.c