summaryrefslogtreecommitdiffstats
path: root/net/ethtool/linkinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ethtool/linkinfo.c')
-rw-r--r--net/ethtool/linkinfo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ethtool/linkinfo.c b/net/ethtool/linkinfo.c
index 2df420068cbb..677068deb68c 100644
--- a/net/ethtool/linkinfo.c
+++ b/net/ethtool/linkinfo.c
@@ -128,9 +128,10 @@ int ethnl_set_linkinfo(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
return ret;
dev = req_info.dev;
+ ret = -EOPNOTSUPP;
if (!dev->ethtool_ops->get_link_ksettings ||
!dev->ethtool_ops->set_link_ksettings)
- return -EOPNOTSUPP;
+ goto out_dev;
rtnl_lock();
ret = ethnl_ops_begin(dev);
@@ -164,6 +165,7 @@ out_ops:
ethnl_ops_complete(dev);
out_rtnl:
rtnl_unlock();
+out_dev:
dev_put(dev);
return ret;
}