linux/net/devlink
Or Har-Toov 1c4dac9bf1 devlink: fix net namespace reference leak in reload
devlink_nl_reload_doit() calls devlink_netns_get(), which returns a net
with a held reference. When the requested namespace differs from the
current one and the reload action is not DRIVER_REINIT, the function
returns -EOPNOTSUPP without releasing the reference. Add the missing
put_net() on this error path.

Fixes: 2edd925704 ("devlink: don't allow to change net namespace for FW_ACTIVATE reload action")
Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Link: https://patch.msgid.link/20260729080600.2427721-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-31 18:23:44 -07:00
..
core.c devlink: Release nested relation on devlink free 2026-06-01 19:54:52 -07:00
dev.c devlink: fix net namespace reference leak in reload 2026-07-31 18:23:44 -07:00
devl_internal.h devlink: Include port resources in resource dump dumpit 2026-04-08 19:55:38 -07:00
dpipe.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
health.c devlink: Fix incorrect skb socket family dumping 2026-04-08 19:34:38 -07:00
linecard.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile devlink: introduce shared devlink instance for PFs on same chip 2026-03-14 13:08:50 -07:00
netlink_gen.c devlink: Implement devlink param multi attribute nested data values 2026-06-13 16:16:58 -07:00
netlink_gen.h devlink: Add port-specific option to resource dump doit 2026-04-08 19:55:39 -07:00
netlink.c devlink: Include port resources in resource dump dumpit 2026-04-08 19:55:38 -07:00
param.c devlink: Implement devlink param multi attribute nested data values 2026-06-13 16:16:58 -07:00
port.c devlink: Add port-level resource registration infrastructure 2026-04-08 19:55:38 -07:00
rate.c devlink: Fix parent ref leak on tc-bw failure 2026-06-18 18:02:29 -07:00
region.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
resource.c devlink: Warn on resource ID collision with PARENT_TOP 2026-06-15 12:41:41 -07:00
sb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sh_dev.c devlink: introduce shared devlink instance for PFs on same chip 2026-03-14 13:08:50 -07:00
trap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00