ethtool: mm: fix get_mm() return code not propagating to user space
Vladimir Oltean
maintainerPATCH 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.
--- net/ethtool/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ethtool/mm.c +1 -1
@@ -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
Quoted 6 lines · Vladimir Oltean
If
ops->get_mm()returns a non-zero error code, we gotoout_complete, but there, we return 0. Fix that to propagate the "ret" variable to the caller. Ifops->get_mm()succeeds, it will always return 0.Fixes 2b30f8291a30 ("net: ethtool: add support for MAC Merge layer")Signed-off-by Vladimir Oltean <[email protected]>
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 gotoout_complete, but there, we return 0. Fix that to propagate the "ret" variable to the caller. Ifops->get_mm()succeeds, it will always return 0.Fixes 2b30f8291a30 ("net: ethtool: add support for MAC Merge layer")Signed-off-by Vladimir Oltean <[email protected]>[...]
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