diff --git a/kernel/fork.c b/kernel/fork.c index 34d8bf4e6fe9..e7a644e66a03 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -627,7 +627,13 @@ static void check_mm(struct mm_struct *mm) int i; for (i = 0; i < NR_MM_COUNTERS; i++) { - long x = atomic_long_read(&mm->rss_stat.count[i]); + long x; + + /* MM_UNRECLAIMABLE could be freed later in exit_files */ + if (i == MM_UNRECLAIMABLE) + continue; + + x = atomic_long_read(&mm->rss_stat.count[i]); if (unlikely(x)) printk(KERN_ALERT "BUG: Bad rss-counter state "