diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-08-15 00:47:23 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-16 01:01:03 +0300 |
commit | f946270d05c26044c67511ef5a9d91e06962d79f (patch) | |
tree | 5e2ed5a4d6937188be0b8b3f13746716ec5a50a3 /net/ethtool/phc_vclocks.c | |
parent | ec0e5b09b834da3889be8458bb0451c3baa803d9 (diff) | |
download | linux-f946270d05c26044c67511ef5a9d91e06962d79f.tar.xz |
ethtool: netlink: always pass genl_info to .prepare_data
We had a number of bugs in the past because developers forgot
to fully test dumps, which pass NULL as info to .prepare_data.
.prepare_data implementations would try to access info->extack
leading to a null-deref.
Now that dumps and notifications can access struct genl_info
we can pass it in, and remove the info null checks.
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # pause
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230814214723.2924989-11-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool/phc_vclocks.c')
-rw-r--r-- | net/ethtool/phc_vclocks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethtool/phc_vclocks.c b/net/ethtool/phc_vclocks.c index 637b2f5297d5..cadaabed60bd 100644 --- a/net/ethtool/phc_vclocks.c +++ b/net/ethtool/phc_vclocks.c @@ -24,7 +24,7 @@ const struct nla_policy ethnl_phc_vclocks_get_policy[] = { static int phc_vclocks_prepare_data(const struct ethnl_req_info *req_base, struct ethnl_reply_data *reply_base, - struct genl_info *info) + const struct genl_info *info) { struct phc_vclocks_reply_data *data = PHC_VCLOCKS_REPDATA(reply_base); struct net_device *dev = reply_base->dev; |