lkml.org 
[lkml]   [2013]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] vmpressure: fix divide-by-0 in vmpressure_work_fn
Hit divide-by-0 in vmpressure_work_fn(): checking vmpr->scanned before
taking the lock is not enough, we must check scanned afterwards too.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: stable@vger.kernel.org
---

mm/vmpressure.c | 3 +++
1 file changed, 3 insertions(+)

--- 3.11/mm/vmpressure.c 2013-09-02 13:46:10.000000000 -0700
+++ linux/mm/vmpressure.c 2013-09-06 22:43:03.596003080 -0700
@@ -187,6 +187,9 @@ static void vmpressure_work_fn(struct wo
vmpr->reclaimed = 0;
spin_unlock(&vmpr->sr_lock);

+ if (!scanned)
+ return;
+
do {
if (vmpressure_event(vmpr, scanned, reclaimed))
break;

\
 
 \ /
  Last update: 2013-09-07 08:21    [W:0.089 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site