netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next v2] ethtool: cabletest: fix wrong conditional check
@ 2024-08-28  2:09 Diogo Jahchan Koike
  2024-08-28  2:33 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Diogo Jahchan Koike @ 2024-08-28  2:09 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Chevallier, Christophe Leroy
  Cc: Diogo Jahchan Koike, syzbot+5cf270e2069645b6bd2c, netdev,
	linux-kernel

In ethnl_act_cable_test_tdr, phydev is tested for the condition of being
null or an error by checking IS_ERR_OR_NULL, however the result is being
negated and lets a null phydev go through. Simply removing the logical
NOT on the conditional suffices.

Reported-by: syzbot+5cf270e2069645b6bd2c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5cf270e2069645b6bd2c
Fixes: 3688ff3077d3 ("net: ethtool: cable-test: Target the command to the requested PHY")
Signed-off-by: Diogo Jahchan Koike <djahchankoike@gmail.com>
---
The previous patch was sent without the appropriate tags, apologize for
that.
---
 net/ethtool/cabletest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index d365ad5f5434..f25da884b3dd 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -346,7 +346,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
 	phydev = ethnl_req_get_phydev(&req_info,
 				      tb[ETHTOOL_A_CABLE_TEST_TDR_HEADER],
 				      info->extack);
-	if (!IS_ERR_OR_NULL(phydev)) {
+	if (IS_ERR_OR_NULL(phydev)) {
 		ret = -EOPNOTSUPP;
 		goto out_dev_put;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-28  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  2:09 [patch net-next v2] ethtool: cabletest: fix wrong conditional check Diogo Jahchan Koike
2024-08-28  2:33 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).