aboutsummaryrefslogtreecommitdiffstats
path: root/patches/next/mm-damon-core-initialize-esz_bp-from-damos_quota_ini.patch
blob: 125407380584af4bd0491bfbcb1f0bd30c2e6888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 9f7065bd9c051d24c03fc48a4e44cb5a25382cc7 Mon Sep 17 00:00:00 2001
From: SeongJae Park <sj@kernel.org>
Date: Thu, 15 Feb 2024 15:36:41 -0800
Subject: [PATCH] mm/damon/core: initialize ->esz_bp from
 damos_quota_init_priv()

damos_quota_init_priv() function should initialize all private fields of
struct damos_quota.  However, it is not initializing ->esz_bp field.
This could result in use of uninitialized variable from
damon_feed_loop_next_input() function.

Note: not Cc-ing stable@ since every DAMON kernel API users are not
causing the issue.

Fixes: 9294a037c015 ("mm/damon/core: implement goal-oriented feedback-driven quota auto-tuning")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 6f4492d13798..37a19534a6f5 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -356,6 +356,7 @@ static struct damos_quota *damos_quota_init(struct damos_quota *quota)
 	quota->charged_from = 0;
 	quota->charge_target_from = NULL;
 	quota->charge_addr_from = 0;
+	quota->esz_bp = 0;
 	return quota;
 }
 
-- 
2.39.2