Skip to contentSkip to conversation

net: ethernet: mtk_eth_soc: fix error code in mtk_flow_offload_replace()

PATCH Applied Dan Carpenter 2 participants 2 messages May 19, 2022 – May 23, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: mtk_eth_soc: fix error code in mtk_flow_offload_replace()

Preserve the error code from mtk_foe_entry_commit(). Do not return success.

Fixes c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management")

---
The original code used to preserve the error code. I'm pretty sure returning an error is the correct thing. I guess please double check this patch.

 drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_ppe_offload.c +2 -1
index 1fe31058b0f2..a641a44323a9 100644
@@ -434,7 +434,8 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
 	memcpy(&entry->data, &foe, sizeof(entry->data));
 	entry->wed_index = wed_index;
 
-	if (mtk_foe_entry_commit(eth->ppe, entry) < 0)
+	err = mtk_foe_entry_commit(eth->ppe, entry);
+	if (err < 0)
 		goto free;
 
 	err = rhashtable_insert_fast(&eth->flow_table, &entry->node,
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 11 lines · On Thu, 19 May 2022 17:08:00 +0300 you wrote:

Preserve the error code from mtk_foe_entry_commit(). Do not return success.

Fixes c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management")

---
The original code used to preserve the error code. I'm pretty sure returning an error is the correct thing. I guess please double check this patch.

[...]

Here is the summary with links:
- [net-next] net: ethernet: mtk_eth_soc: fix error code in mtk_flow_offload_replace()

    https://git.kernel.org/netdev/net-next/c/0097e86c8ec5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html