diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c index 3a91b65c1f9a..f22051f33868 100644 --- a/net/ethtool/cabletest.c +++ b/net/ethtool/cabletest.c @@ -342,9 +342,9 @@ 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; + goto out_rtnl; } ops = ethtool_phy_ops;