[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230907044045.709-1-justinjiang@vivo.com>
Date: Thu, 7 Sep 2023 12:40:45 +0800
From: Zhiguo Jiang <justinjiang@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com, Zhiguo Jiang <justinjiang@...o.com>
Subject: [PATCH] mm: vmscan: fix get_swappiness() return value type
Fix bool to int of the get_swappiness() return value type in
lruvec_is_sizable().
The get_swappiness() return value type is int, but the
get_swappiness() return value type is bool in lruvec_is_sizable().
So there is a possibility of value overflow.
Signed-off-by: Zhiguo Jiang <justinjiang@...o.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
mode change 100644 => 100755 mm/vmscan.c
diff --git a/mm/vmscan.c b/mm/vmscan.c
index ea57a43ebd6b..f383e5b14598
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4575,7 +4575,7 @@ static bool lruvec_is_sizable(struct lruvec *lruvec, struct scan_control *sc)
{
int gen, type, zone;
unsigned long total = 0;
- bool can_swap = get_swappiness(lruvec, sc);
+ int can_swap = get_swappiness(lruvec, sc);
struct lru_gen_folio *lrugen = &lruvec->lrugen;
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
DEFINE_MAX_SEQ(lruvec);
--
2.39.0
Powered by blists - more mailing lists