diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-27 10:44:04 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-27 10:44:04 +0100 |
commit | 67a681c0333be267b80a509151a4553760069bb2 (patch) | |
tree | cbc73b3ab21d0ab843d9bd659fe185f9986be5bb /mm | |
parent | dafe3258c5449e2697097285c37c761915053eae (diff) | |
parent | 2a0458773656240cf6fa97f1126c92dcddf8ab90 (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Diffstat (limited to 'mm')
-rw-r--r-- | mm/huge_memory.c | 2 | ||||
-rw-r--r-- | mm/memcontrol.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 362c329b83f..b92d0ce428b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2286,6 +2286,8 @@ static void collapse_huge_page(struct mm_struct *mm, goto out; vma = find_vma(mm, address); + if (!vma) + goto out; hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK; hend = vma->vm_end & HPAGE_PMD_MASK; if (address < hstart || address + HPAGE_PMD_SIZE > hend) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 82a187aea4c..905ce72c8c4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5584,7 +5584,13 @@ static int compare_thresholds(const void *a, const void *b) const struct mem_cgroup_threshold *_a = a; const struct mem_cgroup_threshold *_b = b; - return _a->threshold - _b->threshold; + if (_a->threshold > _b->threshold) + return 1; + + if (_a->threshold < _b->threshold) + return -1; + + return 0; } static int mem_cgroup_oom_notify_cb(struct mem_cgroup *memcg) |