netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net] net: mvpp2: fix mvpp2 debugfs leak
Date: Mon, 3 Oct 2022 20:46:51 +0200	[thread overview]
Message-ID: <CAPv3WKeCecHxmQS47eqZzSxaeLcu7P9CZ4GPeyEXQucggJ2Xig@mail.gmail.com> (raw)
In-Reply-To: <YzsMQyPJ+I0FqVOA@kroah.com>

pon., 3 paź 2022 o 18:22 Greg Kroah-Hartman
<gregkh@linuxfoundation.org> napisał(a):
>
> 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@armlinux.org.uk>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Thanks for fixing this up properly.
>

I tested the patch and everything works as expected, thanks!

Reviewed-by: Marcin Wojtas <mw@semihalf.com>

Best regards,
Marcin

  reply	other threads:[~2022-10-03 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 16:19 [PATCH net] net: mvpp2: fix mvpp2 debugfs leak Russell King (Oracle)
2022-10-03 16:22 ` Greg Kroah-Hartman
2022-10-03 18:46   ` Marcin Wojtas [this message]
2022-10-04  0:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPv3WKeCecHxmQS47eqZzSxaeLcu7P9CZ4GPeyEXQucggJ2Xig@mail.gmail.com \
    --to=mw@semihalf.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).