linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Kubota Takafumi <takafumi.kubota1012@sslab.ics.keio.ac.jp>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:NETRONOME ETHERNET DRIVERS"
	<oss-drivers@netronome.com>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nfp: Fix memory leak in nfp_resource_acquire()
Date: Fri, 10 Apr 2020 14:21:26 +0900	[thread overview]
Message-ID: <CAEYrHjmy=R0x+zAcANDcTqx2qOhoUjy0Z2okxkjX1JHC3CgZ_A@mail.gmail.com> (raw)
In-Reply-To: <20200409123203.1b5f6534@kicinski-fedora-PC1C0HJN>

Hi,

Thanks for reviewing.

I'll check back the runtime log and see what I can do.
Thanks.


2020年4月10日(金) 4:32 Jakub Kicinski <kuba@kernel.org>:
>
> On Thu,  9 Apr 2020 17:41:11 +0000 Keita Suzuki wrote:
> > This patch fixes a memory leak in nfp_resource_acquire(). res->mutex is
> > alllocated in nfp_resource_try_acquire(). However, when
> > msleep_interruptible() or time_is_before_eq_jiffies() fails, it falls
> > into err_fails path where res is freed, but res->mutex is not.
> >
> > Fix this by changing call to free to nfp_resource_release().
>
> I don't see a leak here. Maybe you could rephrase the description to
> make things clearer?
>
> AFAICS nfp_resource_try_acquire() calls nfp_cpp_mutex_free(res->mutex)
> if it's about to return an error. We can only hit msleep or time check
> if it returned an error.

  reply	other threads:[~2020-04-10  5:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 15:02 [PATCH] nfp: Fix memory leak in nfp_resource_acquire() Keita Suzuki
2020-04-09 17:18 ` David Miller
2020-04-09 17:38   ` Keita Suzuki
2020-04-09 17:41 ` Keita Suzuki
2020-04-09 19:32   ` Jakub Kicinski
2020-04-10  5:21     ` Keita Suzuki [this message]
2020-04-20  7:49 ` kbuild test robot

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='CAEYrHjmy=R0x+zAcANDcTqx2qOhoUjy0Z2okxkjX1JHC3CgZ_A@mail.gmail.com' \
    --to=keitasuzuki.park@sslab.ics.keio.ac.jp \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=takafumi.kubota1012@sslab.ics.keio.ac.jp \
    /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).