Skip to contentSkip to conversation

net: mana: Fix error handling in mana_create_rxq()

PATCH Applied Haiyang Zhang 2 participants 2 messages Oct 8, 2021 – Oct 9, 2021

Subsystems (4)
lore
Share & tools
lore

Haiyang Zhang

author maintainer
#0 lore raw

PATCH v2 1/1 net: mana: Fix error handling in mana_create_rxq()

Fix error handling in mana_create_rxq() when
cq->gdma_id >= gc->max_num_cqs.

Fixes ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +3 -1
index 9a871192ca96..d65697c239c8 100644
@@ -1477,8 +1477,10 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc,
 	if (err)
 		goto out;
 
-	if (cq->gdma_id >= gc->max_num_cqs)
+	if (WARN_ON(cq->gdma_id >= gc->max_num_cqs)) {
+		err = -EINVAL;
 		goto out;
+	}
 
 	gc->cq_table[cq->gdma_id] = cq->gdma_cq;
 
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 8 Oct 2021 06:11:31 -0700 you wrote:

Fix error handling in mana_create_rxq() when
cq->gdma_id >= gc->max_num_cqs.

Fixes ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Here is the summary with links:
- [v2,net] net: mana: Fix error handling in mana_create_rxq()

    https://git.kernel.org/netdev/net/c/be0499369d63

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