diff options
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 9a0178c2ac1d..b02228411d57 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -835,9 +835,9 @@ static bool memory_bm_pfn_present(struct memory_bitmap *bm, unsigned long pfn) | |||
835 | */ | 835 | */ |
836 | static bool rtree_next_node(struct memory_bitmap *bm) | 836 | static bool rtree_next_node(struct memory_bitmap *bm) |
837 | { | 837 | { |
838 | bm->cur.node = list_entry(bm->cur.node->list.next, | 838 | if (!list_is_last(&bm->cur.node->list, &bm->cur.zone->leaves)) { |
839 | struct rtree_node, list); | 839 | bm->cur.node = list_entry(bm->cur.node->list.next, |
840 | if (&bm->cur.node->list != &bm->cur.zone->leaves) { | 840 | struct rtree_node, list); |
841 | bm->cur.node_pfn += BM_BITS_PER_BLOCK; | 841 | bm->cur.node_pfn += BM_BITS_PER_BLOCK; |
842 | bm->cur.node_bit = 0; | 842 | bm->cur.node_bit = 0; |
843 | touch_softlockup_watchdog(); | 843 | touch_softlockup_watchdog(); |
@@ -845,9 +845,9 @@ static bool rtree_next_node(struct memory_bitmap *bm) | |||
845 | } | 845 | } |
846 | 846 | ||
847 | /* No more nodes, goto next zone */ | 847 | /* No more nodes, goto next zone */ |
848 | bm->cur.zone = list_entry(bm->cur.zone->list.next, | 848 | if (!list_is_last(&bm->cur.zone->list, &bm->zones)) { |
849 | bm->cur.zone = list_entry(bm->cur.zone->list.next, | ||
849 | struct mem_zone_bm_rtree, list); | 850 | struct mem_zone_bm_rtree, list); |
850 | if (&bm->cur.zone->list != &bm->zones) { | ||
851 | bm->cur.node = list_entry(bm->cur.zone->leaves.next, | 851 | bm->cur.node = list_entry(bm->cur.zone->leaves.next, |
852 | struct rtree_node, list); | 852 | struct rtree_node, list); |
853 | bm->cur.node_pfn = 0; | 853 | bm->cur.node_pfn = 0; |