summaryrefslogtreecommitdiff
path: root/net/devlink
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-01-18 18:21:15 +0300
committerJakub Kicinski <kuba@kernel.org>2023-01-20 06:08:38 +0300
commit63ba54a52c417a0c632a5f85a2b912b8a2320358 (patch)
tree98b94d83848ae35db03d954ffb62a6908df1789a /net/devlink
parent543753d9e22e3943e2c31c4b5241afafb55dd52a (diff)
downloadlinux-63ba54a52c417a0c632a5f85a2b912b8a2320358.tar.xz
devlink: add instance lock assertion in devl_is_registered()
After region and linecard lock removals, this helper is always supposed to be called with instance lock held. So put the assertion here and remove the comment which is no longer accurate. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink')
-rw-r--r--net/devlink/devl_internal.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 75752f8c4a26..1aa1a9549549 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -85,9 +85,7 @@ struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp);
static inline bool devl_is_registered(struct devlink *devlink)
{
- /* To prevent races the caller must hold the instance lock
- * or another lock taken during unregistration.
- */
+ devl_assert_locked(devlink);
return xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED);
}