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:20:02 +0000 (17:20 +0000)
commit6321330d99e049d155561322c36664fde22ff1bd
tree2cf730b02512e16a95b8ea79a38da9cb3217bdb4
parent7d305a4804f3848f4a304addabf34e7b0156be57
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