Commit 28dbf774 authored by Piergiorgio Beruto's avatar Piergiorgio Beruto Committed by Jakub Kicinski

plca.c: fix obvious mistake in checking retval

Revert a wrong fix that was done during the review process. The
intention was to substitute "if(ret < 0)" with "if(ret)".
Unfortunately, the intended fix did not meet the code.
Besides, after additional review, it was decided that "if(ret < 0)"
was actually the right thing to do.

Fixes: 8580e16c ("net/ethtool: add netlink interface for the PLCA RS")
Signed-off-by: default avatarPiergiorgio Beruto <piergiorgio.beruto@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/f2277af8951a51cfee2fb905af8d7a812b7beaf4.1673616357.git.piergiorgio.beruto@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent da1b0b5c
...@@ -61,7 +61,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_req_info *req_base, ...@@ -61,7 +61,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_req_info *req_base,
} }
ret = ethnl_ops_begin(dev); ret = ethnl_ops_begin(dev);
if (!ret) if (ret < 0)
goto out; goto out;
memset(&data->plca_cfg, 0xff, memset(&data->plca_cfg, 0xff,
...@@ -151,7 +151,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info) ...@@ -151,7 +151,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
tb[ETHTOOL_A_PLCA_HEADER], tb[ETHTOOL_A_PLCA_HEADER],
genl_info_net(info), info->extack, genl_info_net(info), info->extack,
true); true);
if (!ret) if (ret < 0)
return ret; return ret;
dev = req_info.dev; dev = req_info.dev;
...@@ -171,7 +171,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info) ...@@ -171,7 +171,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
} }
ret = ethnl_ops_begin(dev); ret = ethnl_ops_begin(dev);
if (!ret) if (ret < 0)
goto out_rtnl; goto out_rtnl;
memset(&plca_cfg, 0xff, sizeof(plca_cfg)); memset(&plca_cfg, 0xff, sizeof(plca_cfg));
...@@ -189,7 +189,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info) ...@@ -189,7 +189,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
goto out_ops; goto out_ops;
ret = ops->set_plca_cfg(dev->phydev, &plca_cfg, info->extack); ret = ops->set_plca_cfg(dev->phydev, &plca_cfg, info->extack);
if (!ret) if (ret < 0)
goto out_ops; goto out_ops;
ethtool_notify(dev, ETHTOOL_MSG_PLCA_NTF, NULL); ethtool_notify(dev, ETHTOOL_MSG_PLCA_NTF, NULL);
...@@ -233,7 +233,7 @@ static int plca_get_status_prepare_data(const struct ethnl_req_info *req_base, ...@@ -233,7 +233,7 @@ static int plca_get_status_prepare_data(const struct ethnl_req_info *req_base,
} }
ret = ethnl_ops_begin(dev); ret = ethnl_ops_begin(dev);
if (!ret) if (ret < 0)
goto out; goto out;
memset(&data->plca_st, 0xff, memset(&data->plca_st, 0xff,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment