* [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'
@ 2021-06-20 13:43 Christophe JAILLET
2021-06-20 16:58 ` Dexuan Cui
2021-06-21 21:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-06-20 13:43 UTC (permalink / raw)
To: kys, haiyangz, sthemmin, wei.liu, decui, davem, kuba, shacharr,
gustavoars
Cc: linux-hyperv, netdev, linux-kernel, kernel-janitors, Christophe JAILLET
If this test fails we must free some resources as in all the other error
handling paths of this function.
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 46aee2c49f1b..fff78900fc8a 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -1230,8 +1230,10 @@ static int mana_create_txq(struct mana_port_context *apc,
cq->gdma_id = cq->gdma_cq->id;
- if (WARN_ON(cq->gdma_id >= gc->max_num_cqs))
- return -EINVAL;
+ if (WARN_ON(cq->gdma_id >= gc->max_num_cqs)) {
+ err = -EINVAL;
+ goto out;
+ }
gc->cq_table[cq->gdma_id] = cq->gdma_cq;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'
2021-06-20 13:43 [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()' Christophe JAILLET
@ 2021-06-20 16:58 ` Dexuan Cui
2021-06-21 21:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Dexuan Cui @ 2021-06-20 16:58 UTC (permalink / raw)
To: Christophe JAILLET, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, wei.liu, davem, kuba, Shachar Raindel,
gustavoars
Cc: linux-hyperv, netdev, linux-kernel, kernel-janitors
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Sent: Sunday, June 20, 2021 6:43 AM
>
> If this test fails we must free some resources as in all the other error
> handling paths of this function.
>
> Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network
> Adapter (MANA)")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Reviewed-by: Dexuan Cui <decui@microsoft.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'
2021-06-20 13:43 [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()' Christophe JAILLET
2021-06-20 16:58 ` Dexuan Cui
@ 2021-06-21 21:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-21 21:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: kys, haiyangz, sthemmin, wei.liu, decui, davem, kuba, shacharr,
gustavoars, linux-hyperv, netdev, linux-kernel, kernel-janitors
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Sun, 20 Jun 2021 15:43:28 +0200 you wrote:
> If this test fails we must free some resources as in all the other error
> handling paths of this function.
>
> Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Here is the summary with links:
- net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'
https://git.kernel.org/netdev/net/c/b90788459cd6
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] 3+ messages in thread
end of thread, other threads:[~2021-06-21 21:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-20 13:43 [PATCH] net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()' Christophe JAILLET
2021-06-20 16:58 ` Dexuan Cui
2021-06-21 21: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).