ethtool: netlink: always pass genl_info to .prepare_data
authorJakub Kicinski <kuba@kernel.org>
Mon, 14 Aug 2023 21:47:23 +0000 (14:47 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Aug 2023 22:01:03 +0000 (15:01 -0700)
commitf946270d05c26044c67511ef5a9d91e06962d79f
tree5e2ed5a4d6937188be0b8b3f13746716ec5a50a3
parentec0e5b09b834da3889be8458bb0451c3baa803d9
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>
25 files changed:
net/ethtool/channels.c
net/ethtool/coalesce.c
net/ethtool/debug.c
net/ethtool/eee.c
net/ethtool/eeprom.c
net/ethtool/features.c
net/ethtool/fec.c
net/ethtool/linkinfo.c
net/ethtool/linkmodes.c
net/ethtool/linkstate.c
net/ethtool/mm.c
net/ethtool/module.c
net/ethtool/netlink.c
net/ethtool/netlink.h
net/ethtool/pause.c
net/ethtool/phc_vclocks.c
net/ethtool/plca.c
net/ethtool/privflags.c
net/ethtool/pse-pd.c
net/ethtool/rings.c
net/ethtool/rss.c
net/ethtool/stats.c
net/ethtool/strset.c
net/ethtool/tsinfo.c
net/ethtool/wol.c