Re: [PATCH v2 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread SeongJae Park
Hi Jinjie, On Mon, 18 Sep 2023 15:47:59 +0800 Jinjie Ruan wrote: > When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y > and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. > > The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in > damon_test_o

[PATCH v2 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread Jinjie Ruan
When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in damon_test_ops_registration() and damon_test_set_attrs() are not freed. So use damon_destr