]> git.baikalelectronics.ru Git - kernel.git/commit
mm/damon/dbgfs: fix memory leak when using debugfs_lookup()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Sep 2022 19:11:49 +0000 (19:11 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 11 Sep 2022 23:22:31 +0000 (16:22 -0700)
commit8b22a7b7edcff0b4ef0a9b2cddaae806ffb28ec3
tree98fa62d21c52066b8b522616b91a83341c102e34
parentb029be805e2645e27f4d6bcf1649d13bafe9f335
mm/damon/dbgfs: fix memory leak when using debugfs_lookup()

When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  Fix this up by properly calling
dput().

Link: https://lkml.kernel.org/r/20220902191149.112434-1-sj@kernel.org
Fixes: 9e7cd59f27912 ("mm/damon/dbgfs: support multiple contexts")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/dbgfs.c