summaryrefslogtreecommitdiff
path: root/kernel/power/snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r--kernel/power/snapshot.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 542163a01..dc3bab15e 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -812,9 +812,9 @@ static bool memory_bm_pfn_present(struct memory_bitmap *bm, int index, unsigned
*/
static bool rtree_next_node(struct memory_bitmap *bm, int index)
{
- bm->cur[index].node = list_entry(bm->cur[index].node->list.next,
- struct rtree_node, list);
- if (&bm->cur[index].node->list != &bm->cur[index].zone->leaves) {
+ if (!list_is_last(&bm->cur[index].node->list, &bm->cur[index].zone->leaves)) {
+ bm->cur[index].node = list_entry(bm->cur[index].node->list.next,
+ struct rtree_node, list);
bm->cur[index].node_pfn += BM_BITS_PER_BLOCK;
bm->cur[index].node_bit = 0;
touch_softlockup_watchdog();
@@ -822,9 +822,9 @@ static bool rtree_next_node(struct memory_bitmap *bm, int index)
}
/* No more nodes, goto next zone */
- bm->cur[index].zone = list_entry(bm->cur[index].zone->list.next,
+ if (!list_is_last(&bm->cur[index].zone->list, &bm->zones)) {
+ bm->cur[index].zone = list_entry(bm->cur[index].zone->list.next,
struct mem_zone_bm_rtree, list);
- if (&bm->cur[index].zone->list != &bm->zones) {
bm->cur[index].node = list_entry(bm->cur[index].zone->leaves.next,
struct rtree_node, list);
bm->cur[index].node_pfn = 0;