Commit 08bf4204 authored by SeongJae Park's avatar SeongJae Park Committed by Treehugger Robot
Browse files

UPSTREAM: mm/damon/core: initialize damon_target->list in damon_new_target()

'struct damon_target' creation function, 'damon_new_target()' is not
initializing its '->list' field, unlike other DAMON structs creator
functions such as 'damon_new_region()'.  Normal users of
'damon_new_target()' initializes the field by adding the target to DAMON
context's targets list, but some code could access the uninitialized
field.

This commit avoids the case by initializing the field in
'damon_new_target()'.

Bug: 254441685
Link: https://lkml.kernel.org/r/20221002193130.8227-1-sj@kernel.org


Fixes: f23b8eee ("mm/damon/core: implement region-based sampling")
Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
Reported-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
(cherry picked from commit b1f44cda)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I42adfe86cbe78f45c04a66d486261234e16d463f
parent 94ce24b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment