Commit 1c8e234
damon/sysfs: fix possible memleak on damon_sysfs_add_target
When damon_sysfs_add_target couldn't find proper task, New allocated
damon_target structure isn't registered yet, So, it's impossible to free
new allocated one by damon_sysfs_destroy_targets.
By calling damon_add_target as soon as allocating new target, Fix this
possible memory leak.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: a61ea56 ("mm/damon/sysfs: link DAMON for virtual address spaces monitoring")
Signed-off-by: Levi Yun <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Cc: <[email protected]> [5.17.x]
Signed-off-by: Andrew Morton <[email protected]>1 parent 30c1936 commit 1c8e234
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2182 | 2182 | | |
2183 | 2183 | | |
2184 | 2184 | | |
| 2185 | + | |
2185 | 2186 | | |
2186 | 2187 | | |
2187 | 2188 | | |
2188 | 2189 | | |
2189 | 2190 | | |
2190 | | - | |
2191 | 2191 | | |
2192 | 2192 | | |
2193 | 2193 | | |
| |||
0 commit comments