diff options
author | Moshe Shemesh <moshe@nvidia.com> | 2022-07-11 01:14:08 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-07-12 10:26:23 +0200 |
commit | f0680ef0f9497f88b513dea1ae54664f0806ecfb (patch) | |
tree | dd85580ea6dd577bdd216c81441f5cce4bdd6705 /net/core | |
parent | 973598d46ede27bb3b2a54ff45135196aeb9efb0 (diff) |
devlink: Hold the instance lock in port_new / port_del callbacks
Let the core take the devlink instance lock around port_new and port_del
callbacks and remove the now redundant locking in the only driver that
currently use them.
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/devlink.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index 970e5c2a52bd..e206cc90bec5 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -1712,7 +1712,7 @@ static int devlink_port_new_notifiy(struct devlink *devlink, if (!msg) return -ENOMEM; - mutex_lock(&devlink->lock); + lockdep_assert_held(&devlink->lock); devlink_port = devlink_port_get_by_index(devlink, port_index); if (!devlink_port) { err = -ENODEV; @@ -1725,11 +1725,9 @@ static int devlink_port_new_notifiy(struct devlink *devlink, goto out; err = genlmsg_reply(msg, info); - mutex_unlock(&devlink->lock); return err; out: - mutex_unlock(&devlink->lock); nlmsg_free(msg); return err; } @@ -9067,13 +9065,11 @@ static const struct genl_small_ops devlink_nl_ops[] = { .cmd = DEVLINK_CMD_PORT_NEW, .doit = devlink_nl_cmd_port_new_doit, .flags = GENL_ADMIN_PERM, - .internal_flags = DEVLINK_NL_FLAG_NO_LOCK, }, { .cmd = DEVLINK_CMD_PORT_DEL, .doit = devlink_nl_cmd_port_del_doit, .flags = GENL_ADMIN_PERM, - .internal_flags = DEVLINK_NL_FLAG_NO_LOCK, }, { .cmd = DEVLINK_CMD_LINECARD_GET, |