diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index afb4e9ebc842..3181692d34d2 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -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; } }