aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 41a3da3d6ccc..16180587fd7d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -377,8 +377,8 @@ static pageout_t pageout(struct page *page, struct address_space *mapping)
377 377
378int remove_mapping(struct address_space *mapping, struct page *page) 378int remove_mapping(struct address_space *mapping, struct page *page)
379{ 379{
380 if (!mapping) 380 BUG_ON(!PageLocked(page));
381 return 0; /* truncate got there first */ 381 BUG_ON(mapping != page_mapping(page));
382 382
383 write_lock_irq(&mapping->tree_lock); 383 write_lock_irq(&mapping->tree_lock);
384 384
@@ -547,7 +547,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
547 goto free_it; 547 goto free_it;
548 } 548 }
549 549
550 if (!remove_mapping(mapping, page)) 550 if (!mapping || !remove_mapping(mapping, page))
551 goto keep_locked; 551 goto keep_locked;
552 552
553free_it: 553free_it: