aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/android/lowmemorykiller.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index f61333b9602..cba3b91d728 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -92,12 +92,18 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
92 for_each_process(p) { 92 for_each_process(p) {
93 int oom_adj; 93 int oom_adj;
94 94
95 if (!p->mm) 95 task_lock(p);
96 if (!p->mm) {
97 task_unlock(p);
96 continue; 98 continue;
99 }
97 oom_adj = p->oomkilladj; 100 oom_adj = p->oomkilladj;
98 if (oom_adj < min_adj) 101 if (oom_adj < min_adj) {
102 task_unlock(p);
99 continue; 103 continue;
104 }
100 tasksize = get_mm_rss(p->mm); 105 tasksize = get_mm_rss(p->mm);
106 task_unlock(p);
101 if (tasksize <= 0) 107 if (tasksize <= 0)
102 continue; 108 continue;
103 if (selected) { 109 if (selected) {