lkml.org 
[lkml]   [2022]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm/damon/dbgfs: fix memory leak when using
On Fri, Sep 02, 2022 at 07:11:49PM +0000, SeongJae Park wrote:
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> debugfs_lookup()
> Date: Fri, 2 Sep 2022 14:56:31 +0200 [thread overview]
> Message-ID: <20220902125631.128329-1-gregkh@linuxfoundation.org> (raw)
>
> 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().
>
> Fixes: 75c1c2b53c78b ("mm/damon/dbgfs: support multiple contexts")
> Cc: <stable@vger.kernel.org> # 5.15.x
> Cc: SeongJae Park <sj@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: damon@lists.linux.dev
> Cc: linux-mm@kvack.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: SeongJae Park <sj@kernel.org>
> ---
> Changes from v1
> (https://lore.kernel.org/damon/20220902125631.128329-1-gregkh@linuxfoundation.org/)
> - Call dput() for failure-return case (Andrew Morton)

Thanks for fixing this up, I missed the other return error cases in my
rush to audit the whole tree at once.

This version looks great, and I see Andrew has taken it now into his
tree, thanks!

greg k-h

\
 
 \ /
  Last update: 2022-09-03 09:08    [W:0.059 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site