summaryrefslogtreecommitdiff
path: root/net/ethtool/netlink.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-01-18 18:05:12 -0800
committerJakub Kicinski <kuba@kernel.org>2025-01-20 11:44:57 -0800
commit743dea746ed6d581877c114ef1f362bc277fed6a (patch)
tree37c2083593f74fb09e9eeaf999b3755f7102219b /net/ethtool/netlink.c
parent3c836451ca9041cfb32a7d8f59ea15b3b991bbb3 (diff)
net: ethtool: store netdev in a temp variable in ethnl_default_set_doit()
For ease of review of the next patch store the dev pointer on the stack, instead of referring to req_info.dev every time. No functional changes. Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250119020518.1962249-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool/netlink.c')
-rw-r--r--net/ethtool/netlink.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index 849c98e637c6..c17d8513d4c1 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -667,6 +667,7 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
const struct ethnl_request_ops *ops;
struct ethnl_req_info req_info = {};
const u8 cmd = info->genlhdr->cmd;
+ struct net_device *dev;
int ret;
ops = ethnl_default_requests[cmd];
@@ -688,19 +689,21 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
goto out_dev;
}
+ dev = req_info.dev;
+
rtnl_lock();
- ret = ethnl_ops_begin(req_info.dev);
+ ret = ethnl_ops_begin(dev);
if (ret < 0)
goto out_rtnl;
ret = ops->set(&req_info, info);
if (ret <= 0)
goto out_ops;
- ethtool_notify(req_info.dev, ops->set_ntf_cmd, NULL);
+ ethtool_notify(dev, ops->set_ntf_cmd, NULL);
ret = 0;
out_ops:
- ethnl_ops_complete(req_info.dev);
+ ethnl_ops_complete(dev);
out_rtnl:
rtnl_unlock();
out_dev: