linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethernet: marvell: octeontx2 Fix resource not freed after malloc
@ 2022-10-17 19:17 Manank Patel
  2022-10-18  3:54 ` sundeep subbaraya
  0 siblings, 1 reply; 4+ messages in thread
From: Manank Patel @ 2022-10-17 19:17 UTC (permalink / raw)
  To: sgoutham
  Cc: gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, Manank Patel

fix rxsc not getting freed before going out of scope

Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")

Signed-off-by: Manank Patel <pmanank200502@gmail.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
index 9809f551fc2e..c7b2ebb2c75b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -870,6 +870,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)
 	cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_FLOWID,
 			    rxsc->hw_flow_id, false);
 fail:
+	kfree(rxsc);
 	return ERR_PTR(ret);
 }
 
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ethernet: marvell: octeontx2 Fix resource not freed after malloc
  2022-10-17 19:17 [PATCH] ethernet: marvell: octeontx2 Fix resource not freed after malloc Manank Patel
@ 2022-10-18  3:54 ` sundeep subbaraya
  2022-10-18  5:33   ` [PATCH v2] " Manank Patel
  0 siblings, 1 reply; 4+ messages in thread
From: sundeep subbaraya @ 2022-10-18  3:54 UTC (permalink / raw)
  To: Manank Patel
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel

Hi,

On Tue, Oct 18, 2022 at 1:27 AM Manank Patel <pmanank200502@gmail.com> wrote:
>
> fix rxsc not getting freed before going out of scope
>
> Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
>
> Signed-off-by: Manank Patel <pmanank200502@gmail.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> index 9809f551fc2e..c7b2ebb2c75b 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> @@ -870,6 +870,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)
>         cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_FLOWID,
>                             rxsc->hw_flow_id, false);
>  fail:
> +       kfree(rxsc);

Thanks for the fix. Can you do the same in cn10k_mcs_create_txsc as well.

Sundeep

>         return ERR_PTR(ret);
>  }
>
> --
> 2.38.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] ethernet: marvell: octeontx2 Fix resource not freed after malloc
  2022-10-18  3:54 ` sundeep subbaraya
@ 2022-10-18  5:33   ` Manank Patel
  2022-10-19 12:50     ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 4+ messages in thread
From: Manank Patel @ 2022-10-18  5:33 UTC (permalink / raw)
  To: sgoutham
  Cc: gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, sundeep.lkml, Manank Patel

fix rxsc and txsc not getting freed before going out of scope

Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")

Signed-off-by: Manank Patel <pmanank200502@gmail.com>
---

Changelog
    v1->v2:
            add the same fix in cn10k_mcs_create_txsc

 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
index 9809f551fc2e..9ec5f38d38a8 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -815,6 +815,7 @@ static struct cn10k_mcs_txsc *cn10k_mcs_create_txsc(struct otx2_nic *pfvf)
 	cn10k_mcs_free_rsrc(pfvf, MCS_TX, MCS_RSRC_TYPE_FLOWID,
 			    txsc->hw_flow_id, false);
 fail:
+	kfree(txsc);
 	return ERR_PTR(ret);
 }
 
@@ -870,6 +871,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)
 	cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_FLOWID,
 			    rxsc->hw_flow_id, false);
 fail:
+	kfree(rxsc);
 	return ERR_PTR(ret);
 }
 
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ethernet: marvell: octeontx2 Fix resource not freed after malloc
  2022-10-18  5:33   ` [PATCH v2] " Manank Patel
@ 2022-10-19 12:50     ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-19 12:50 UTC (permalink / raw)
  To: Manank Patel
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel, sundeep.lkml

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 18 Oct 2022 11:03:18 +0530 you wrote:
> fix rxsc and txsc not getting freed before going out of scope
> 
> Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
> 
> Signed-off-by: Manank Patel <pmanank200502@gmail.com>
> ---
> 
> [...]

Here is the summary with links:
  - [v2] ethernet: marvell: octeontx2 Fix resource not freed after malloc
    https://git.kernel.org/netdev/net/c/7b55c2ed2ba0

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-19 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 19:17 [PATCH] ethernet: marvell: octeontx2 Fix resource not freed after malloc Manank Patel
2022-10-18  3:54 ` sundeep subbaraya
2022-10-18  5:33   ` [PATCH v2] " Manank Patel
2022-10-19 12:50     ` patchwork-bot+netdevbpf

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).