Skip to content

Commit c1eb251

Browse files
committed
RDMA/mlx5: Remove extra unlock on error path
The below commit lifted the locking out of this function but left this error path unlock behind resulting in unbalanced locking. Remove the missed unlock too. Cc: stable@vger.kernel.org Fixes: 6271222 ("RDMA/mlx5: Add work to remove temporary entries from the cache") Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Michael Guralnik <michaelgur@nvidia.com> Link: https://lore.kernel.org/r/78090c210c750f47219b95248f9f782f34548bb1.1716900410.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent f67ac00 commit c1eb251

File tree

1 file changed

+1
-3
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+1
-3
lines changed

drivers/infiniband/hw/mlx5/mr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,8 @@ static int mlx5_cache_ent_insert(struct mlx5_mkey_cache *cache,
641641
new = &((*new)->rb_left);
642642
if (cmp < 0)
643643
new = &((*new)->rb_right);
644-
if (cmp == 0) {
645-
mutex_unlock(&cache->rb_lock);
644+
if (cmp == 0)
646645
return -EEXIST;
647-
}
648646
}
649647

650648
/* Add new node and rebalance tree. */

0 commit comments

Comments
 (0)