devlink: protect devlink->dev by the instance lock
authorJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 06:33:56 +0000 (22:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Jan 2023 12:56:18 +0000 (12:56 +0000)
commit870c7ad4a52be2acff92d0355ca118654c7efece
tree17e94f028695b80ebf2dfcfc1e94a6b222cf070d
parent7a54a5195b2a877a972ec21a5ca415c1fc2aec61
devlink: protect devlink->dev by the instance lock

devlink->dev is assumed to be always valid as long as any
outstanding reference to the devlink instance exists.

In prep for weakening of the references take the instance lock.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/devlink/devl_internal.h
net/devlink/leftover.c
net/devlink/netlink.c