[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzsMQyPJ+I0FqVOA@kroah.com>
Date: Mon, 3 Oct 2022 18:22:27 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Sasha Levin <sashal@...nel.org>,
Marcin Wojtas <mw@...ihalf.com>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net] net: mvpp2: fix mvpp2 debugfs leak
On Mon, Oct 03, 2022 at 05:19:27PM +0100, Russell King (Oracle) wrote:
> When mvpp2 is unloaded, the driver specific debugfs directory is not
> removed, which technically leads to a memory leak. However, this
> directory is only created when the first device is probed, so the
> hardware is present. Removing the module is only something a developer
> would to when e.g. testing out changes, so the module would be
> reloaded. So this memory leak is minor.
>
> The original attempt in commit fe2c9c61f668 ("net: mvpp2: debugfs: fix
> memory leak when using debugfs_lookup()") that was labelled as a memory
> leak fix was not, it fixed a refcount leak, but in doing so created a
> problem when the module is reloaded - the directory already exists, but
> mvpp2_root is NULL, so we lose all debugfs entries. This fix has been
> reverted.
>
> This is the alternative fix, where we remove the offending directory
> whenever the driver is unloaded.
>
> Fixes: 21da57a23125 ("net: mvpp2: add a debugfs interface for the Header Parser")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Thanks for fixing this up properly.
greg k-h
Powered by blists - more mailing lists