diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/mm/memory.c b/mm/memory.c index ce3c9e4492d8..0d14d1e58a5f 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1711,7 +1711,7 @@ unlock: | |||
1711 | } | 1711 | } |
1712 | return ret; | 1712 | return ret; |
1713 | oom_free_new: | 1713 | oom_free_new: |
1714 | __free_page(new_page); | 1714 | page_cache_release(new_page); |
1715 | oom: | 1715 | oom: |
1716 | if (old_page) | 1716 | if (old_page) |
1717 | page_cache_release(old_page); | 1717 | page_cache_release(old_page); |
@@ -2093,12 +2093,9 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2093 | unlock_page(page); | 2093 | unlock_page(page); |
2094 | 2094 | ||
2095 | if (write_access) { | 2095 | if (write_access) { |
2096 | /* XXX: We could OR the do_wp_page code with this one? */ | 2096 | ret |= do_wp_page(mm, vma, address, page_table, pmd, ptl, pte); |
2097 | if (do_wp_page(mm, vma, address, | 2097 | if (ret & VM_FAULT_ERROR) |
2098 | page_table, pmd, ptl, pte) & VM_FAULT_OOM) { | 2098 | ret &= VM_FAULT_ERROR; |
2099 | mem_cgroup_uncharge_page(page); | ||
2100 | ret = VM_FAULT_OOM; | ||
2101 | } | ||
2102 | goto out; | 2099 | goto out; |
2103 | } | 2100 | } |
2104 | 2101 | ||
@@ -2163,7 +2160,7 @@ release: | |||
2163 | page_cache_release(page); | 2160 | page_cache_release(page); |
2164 | goto unlock; | 2161 | goto unlock; |
2165 | oom_free_page: | 2162 | oom_free_page: |
2166 | __free_page(page); | 2163 | page_cache_release(page); |
2167 | oom: | 2164 | oom: |
2168 | return VM_FAULT_OOM; | 2165 | return VM_FAULT_OOM; |
2169 | } | 2166 | } |