mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
BACKPORT: mm/damon/dbgfs: fix missed use of damon_dbgfs_lock
DAMON debugfs is supposed to protect dbgfs_ctxs, dbgfs_nr_ctxs, and dbgfs_dirs using damon_dbgfs_lock. However, some of the code is accessing the variables without the protection. This fixes it by protecting all such accesses. Link: https://lkml.kernel.org/r/20211110145758.16558-3-sj@kernel.org Fixes:75c1c2b53c("mm/damon/dbgfs: support multiple contexts") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commitd78f3853f8) Bug: 228223814 Signed-off-by: zhijun wan <wanzhijun@oppo.com> Change-Id: Ibdfcc75f9f219b69a4b4e6161af257c1d0eba891
This commit is contained in:
committed by
Carlos Llamas
parent
cae7a76485
commit
b9943b9604
@@ -894,6 +894,7 @@ static ssize_t dbgfs_monitor_on_write(struct file *file,
|
||||
for (i = 0; i < dbgfs_nr_ctxs; i++) {
|
||||
if (damon_targets_empty(dbgfs_ctxs[i])) {
|
||||
kfree(kbuf);
|
||||
mutex_unlock(&damon_dbgfs_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user