Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190204
b: refs/heads/master
c: 22eccdd
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Linus Torvalds committed Apr 24, 2010
1 parent 1d929db commit 263b530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 453dc65931915abc61f92e12bba1fc4747ff5542
refs/heads/master: 22eccdd7d2d94be48ae9b01fef5f52ccbb81dcd5
12 changes: 6 additions & 6 deletions trunk/mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
do {
cond_resched();
page = follow_page(vma, addr, FOLL_GET);
if (!page)
if (IS_ERR_OR_NULL(page))
break;
if (PageKsm(page))
ret = handle_mm_fault(vma->vm_mm, vma, addr,
Expand Down Expand Up @@ -447,7 +447,7 @@ static struct page *get_mergeable_page(struct rmap_item *rmap_item)
goto out;

page = follow_page(vma, addr, FOLL_GET);
if (!page)
if (IS_ERR_OR_NULL(page))
goto out;
if (PageAnon(page)) {
flush_anon_page(vma, page, addr);
Expand Down Expand Up @@ -1086,7 +1086,7 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item,
cond_resched();
tree_rmap_item = rb_entry(*new, struct rmap_item, node);
tree_page = get_mergeable_page(tree_rmap_item);
if (!tree_page)
if (IS_ERR_OR_NULL(tree_page))
return NULL;

/*
Expand Down Expand Up @@ -1294,7 +1294,7 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
if (ksm_test_exit(mm))
break;
*page = follow_page(vma, ksm_scan.address, FOLL_GET);
if (*page && PageAnon(*page)) {
if (!IS_ERR_OR_NULL(*page) && PageAnon(*page)) {
flush_anon_page(vma, *page, ksm_scan.address);
flush_dcache_page(*page);
rmap_item = get_next_rmap_item(slot,
Expand All @@ -1308,7 +1308,7 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
up_read(&mm->mmap_sem);
return rmap_item;
}
if (*page)
if (!IS_ERR_OR_NULL(*page))
put_page(*page);
ksm_scan.address += PAGE_SIZE;
cond_resched();
Expand Down Expand Up @@ -1367,7 +1367,7 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
static void ksm_do_scan(unsigned int scan_npages)
{
struct rmap_item *rmap_item;
struct page *page;
struct page *uninitialized_var(page);

while (scan_npages--) {
cond_resched();
Expand Down

0 comments on commit 263b530

Please sign in to comment.