From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Maxim Levitsky <mlevitsk@redhat.com>
Cc: kvm@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Haiyang Zhang <haiyangz@microsoft.com>,
Souradeep Chakrabarti <schakrabarti@linux.microsoft.com>,
linux-hyperv@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org,
Konstantin Taranov <kotaranov@microsoft.com>,
Leon Romanovsky <leon@kernel.org>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Andrew Lunn <andrew+netdev@lunn.ch>,
Shradha Gupta <shradhagupta@linux.microsoft.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Long Li <longli@microsoft.com>, Yury Norov <yury.norov@gmail.com>
Subject: Re: [PATCH v2 1/2] net: mana: Fix memory leak in mana_gd_setup_irqs
Date: Tue, 10 Dec 2024 07:17:55 +0100 [thread overview]
Message-ID: <Z1fdE6ftFMtVFeW5@mev-dev.igk.intel.com> (raw)
In-Reply-To: <Z1fcIa7n+hI+v2Nq@mev-dev.igk.intel.com>
On Tue, Dec 10, 2024 at 07:13:53AM +0100, Michal Swiatkowski wrote:
> On Mon, Dec 09, 2024 at 12:57:50PM -0500, Maxim Levitsky wrote:
> > Commit 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
> > added memory allocation in mana_gd_setup_irqs of 'irqs' but the code
> > doesn't free this temporary array in the success path.
> >
> > This was caught by kmemleak.
> >
> > Fixes: 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
> > Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> > ---
> > drivers/net/ethernet/microsoft/mana/gdma_main.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > index e97af7ac2bb2..aba188f9f10f 100644
> > --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> > @@ -1375,6 +1375,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
> > gc->max_num_msix = nvec;
> > gc->num_msix_usable = nvec;
> > cpus_read_unlock();
> > + kfree(irqs);
>
> Ther is still memleak in case of jumping to free_irq_vector when
> gc->irq_contexts allocation is failing.
>
Ignore that, just took a look at second patch.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Thanks
> > return 0;
> >
> > free_irq:
> > --
> > 2.26.3
next prev parent reply other threads:[~2024-12-10 6:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 17:57 [PATCH v2 0/2] MANA: Fix few memory leaks in mana_gd_setup_irqs Maxim Levitsky
2024-12-09 17:57 ` [PATCH v2 1/2] net: mana: Fix memory leak " Maxim Levitsky
2024-12-10 6:13 ` Michal Swiatkowski
2024-12-10 6:17 ` Michal Swiatkowski [this message]
2024-12-10 8:05 ` Kalesh Anakkur Purayil
2024-12-09 17:57 ` [PATCH v2 2/2] net: mana: Fix irq_contexts " Maxim Levitsky
2024-12-10 6:19 ` Michal Swiatkowski
2024-12-10 8:07 ` Kalesh Anakkur Purayil
2024-12-10 6:23 ` [PATCH v2 0/2] MANA: Fix few memory leaks " Michal Swiatkowski
2024-12-10 10:24 ` Saurabh Singh Sengar
2024-12-11 18:34 ` Yury Norov
2024-12-12 4:30 ` 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=Z1fdE6ftFMtVFeW5@mev-dev.igk.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=kotaranov@microsoft.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=mlevitsk@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=schakrabarti@linux.microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=wei.liu@kernel.org \
--cc=yury.norov@gmail.com \
/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).