linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmpressure: fix divide-by-0 in vmpressure_work_fn
@ 2013-09-07  5:59 Hugh Dickins
  2013-09-08  1:43 ` David Rientjes
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hugh Dickins @ 2013-09-07  5:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Anton Vorontsov, Michal Hocko, David Rientjes, linux-kernel,
	linux-mm

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;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-09-12 11:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-07  5:59 [PATCH] vmpressure: fix divide-by-0 in vmpressure_work_fn Hugh Dickins
2013-09-08  1:43 ` David Rientjes
2013-09-09 11:08 ` Michal Hocko
2013-09-11 15:40   ` Anton Vorontsov
2013-09-11 16:03     ` Michal Hocko
2013-09-11 16:12       ` Anton Vorontsov
2013-09-11 20:04       ` Hugh Dickins
2013-09-12 11:46         ` Michal Hocko
2013-09-11  5:32 ` Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).