Skip to contentSkip to conversation

ethtool: mm: fix get_mm() return code not propagating to user space

PATCH Applied Vladimir Oltean 3 participants 3 messages Feb 6, 2023 – Feb 7, 2023

Subsystems (4)
lore
Share & tools
lore

Vladimir Oltean

author maintainer
#0 lore raw

PATCH 1/1 ethtool: mm: fix get_mm() return code not propagating to user space

If ops->get_mm() returns a non-zero error code, we goto out_complete, but there, we return 0. Fix that to propagate the "ret" variable to the caller. If ops->get_mm() succeeds, it will always return 0.

Fixes 2b30f8291a30 ("net: ethtool: add support for MAC Merge layer")
---
 net/ethtool/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ethtool/mm.c +1 -1
index 7e51f7633001..e612856eed8c 100644
@@ -56,7 +56,7 @@ static int mm_prepare_data(const struct ethnl_req_info *req_base,
 out_complete:
 	ethnl_ops_complete(dev);
 
-	return 0;
+	return ret;
 }
 
 static int mm_reply_size(const struct ethnl_req_info *req_base,
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Vladimir Oltean

If ops->get_mm() returns a non-zero error code, we goto out_complete, but there, we return 0. Fix that to propagate the "ret" variable to the caller. If ops->get_mm() succeeds, it will always return 0.

Fixes 2b30f8291a30 ("net: ethtool: add support for MAC Merge layer")
#2 lore raw
In reply to Vladimir Oltean
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Hello:

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

Quoted 8 lines · On Mon, 6 Feb 2023 11:49:32 +0200 you wrote:

If ops->get_mm() returns a non-zero error code, we goto out_complete, but there, we return 0. Fix that to propagate the "ret" variable to the caller. If ops->get_mm() succeeds, it will always return 0.

Fixes 2b30f8291a30 ("net: ethtool: add support for MAC Merge layer")

[...]

Here is the summary with links:
- [net-next] ethtool: mm: fix get_mm() return code not propagating to user space

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

You are awesome, thank you!

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