net: devlink: move netdev notifier block to dest namespace during reload
authorJiri Pirko <jiri@nvidia.com>
Tue, 8 Nov 2022 13:22:07 +0000 (14:22 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Nov 2022 21:45:59 +0000 (13:45 -0800)
commit15feb56e30efea95992f5c572cee753db205eb7b
tree7b135eb065d73822fdccb40ee9af123e8c3e75d1
parent3e52fba03a20234abc65a656cef063a1045d9723
net: devlink: move netdev notifier block to dest namespace during reload

The notifier block tracking netdev changes in devlink is registered
during devlink_alloc() per-net, it is then unregistered
in devlink_free(). When devlink moves from net namespace to another one,
the notifier block needs to move along.

Fix this by adding forgotten call to move the block.

Reported-by: Ido Schimmel <idosch@idosch.org>
Fixes: 02a68a47eade ("net: devlink: track netdev with devlink_port assigned")
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/devlink.c