From: Andrew Morton Date: Thu, 30 Apr 2009 22:08:55 +0000 (-0700) Subject: vmscan: avoid multiplication overflow in shrink_zone() X-Git-Tag: MMI-PSA29.97-13-9~28263 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8713e01295140f674a41f2199b0f7ca99dfb69d5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git vmscan: avoid multiplication overflow in shrink_zone() Local variable `scan' can overflow on zones which are larger than (2G * 4k) / 100 = 80GB. Making it 64-bit on 64-bit will fix that up. Cc: KOSAKI Motohiro Cc: Wu Fengguang Cc: Peter Zijlstra Cc: Rik van Riel Cc: Lee Schermerhorn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index eac9577941f9..5fa3eda1f03f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, struct zone *zone, for_each_evictable_lru(l) { int file = is_file_lru(l); - int scan; + unsigned long scan; scan = zone_nr_pages(zone, sc, l); if (priority) {