summaryrefslogtreecommitdiff
path: root/net/ethtool/netlink.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-12-14 00:42:30 -0800
committerDavid S. Miller <davem@davemloft.net>2021-12-15 10:27:47 +0000
commit34ac17ecbf575eb079094d44f1bd30c66897aa21 (patch)
tree2b548e07ac179eb8b5dbcb8f45a953c0baf1ef6e /net/ethtool/netlink.h
parent6cf7a1ac0fedad8a70c050ade8a27a2071638500 (diff)
ethtool: use ethnl_parse_header_dev_put()
It seems I missed that most ethnl_parse_header_dev_get() callers declare an on-stack struct ethnl_req_info, and that they simply call dev_put(req_info.dev) when about to return. Add ethnl_parse_header_dev_put() helper to properly untrack reference taken by ethnl_parse_header_dev_get(). Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/netlink.h')
-rw-r--r--net/ethtool/netlink.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
index a779bbb0c524..75856db299e9 100644
--- a/net/ethtool/netlink.h
+++ b/net/ethtool/netlink.h
@@ -235,6 +235,11 @@ struct ethnl_req_info {
u32 flags;
};
+static inline void ethnl_parse_header_dev_put(struct ethnl_req_info *req_info)
+{
+ dev_put_track(req_info->dev, &req_info->dev_tracker);
+}
+
/**
* struct ethnl_reply_data - base type of reply data for GET requests
* @dev: device for current reply message; in single shot requests it is