[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1fda7FRu+vmkt0S@mev-dev.igk.intel.com>
Date: Tue, 10 Dec 2024 07:19:23 +0100
From: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
To: Maxim Levitsky <mlevitsk@...hat.com>
Cc: kvm@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>,
linux-hyperv@...r.kernel.org, Dexuan Cui <decui@...rosoft.com>,
Paolo Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org,
Konstantin Taranov <kotaranov@...rosoft.com>,
Leon Romanovsky <leon@...nel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
Shradha Gupta <shradhagupta@...ux.microsoft.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>, Long Li <longli@...rosoft.com>,
Yury Norov <yury.norov@...il.com>,
Michael Kelley <mhklinux@...look.com>
Subject: Re: [PATCH v2 2/2] net: mana: Fix irq_contexts memory leak in
mana_gd_setup_irqs
On Mon, Dec 09, 2024 at 12:57:51PM -0500, Maxim Levitsky wrote:
> gc->irq_contexts is not freeded if one of the later operations
> fail.
>
> Suggested-by: Michael Kelley <mhklinux@...look.com>
> Fixes: 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
> Signed-off-by: Maxim Levitsky <mlevitsk@...hat.com>
> ---
> drivers/net/ethernet/microsoft/mana/gdma_main.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> index aba188f9f10f..6297c0869cd6 100644
> --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> @@ -1318,7 +1318,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
> GFP_KERNEL);
> if (!gc->irq_contexts) {
> err = -ENOMEM;
> - goto free_irq_vector;
> + goto free_irq_array;
> }
>
> for (i = 0; i < nvec; i++) {
> @@ -1388,8 +1388,9 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
> }
>
> kfree(gc->irq_contexts);
> - kfree(irqs);
> gc->irq_contexts = NULL;
> +free_irq_array:
> + kfree(irqs);
> free_irq_vector:
> cpus_read_unlock();
> pci_free_irq_vectors(pdev);
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
> --
> 2.26.3
Powered by blists - more mailing lists