linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: Parav Pandit <parav@nvidia.com>,
	Aharon Landau <aharonl@nvidia.com>,
	linux-rdma@vger.kernel.org, Maor Gottlieb <maorg@mellanox.com>,
	Mark Bloch <mbloch@nvidia.com>
Subject: [PATCH rdma-next 3/5] IB/mlx5: Add mutex destroy call to cap_mask_mutex mutex
Date: Wed, 13 Jan 2021 14:17:01 +0200	[thread overview]
Message-ID: <20210113121703.559778-4-leon@kernel.org> (raw)
In-Reply-To: <20210113121703.559778-1-leon@kernel.org>

From: Parav Pandit <parav@nvidia.com>

Mutex destroy call for device's cap_mask_mutex mutex is missing, let's
add it to annotate destruction.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/mlx5/main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 4f21e561f73e..84309bcd67d5 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3951,7 +3951,7 @@ static void mlx5_ib_stage_init_cleanup(struct mlx5_ib_dev *dev)
 	mlx5_ib_cleanup_multiport_master(dev);
 	WARN_ON(!xa_empty(&dev->odp_mkeys));
 	cleanup_srcu_struct(&dev->odp_srcu);
-
+	mutex_destroy(&dev->cap_mask_mutex);
 	WARN_ON(!xa_empty(&dev->sig_mrs));
 	WARN_ON(!bitmap_empty(dev->dm.memic_alloc_pages, MLX5_MAX_MEMIC_PAGES));
 }
@@ -4002,6 +4002,10 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
 	dev->ib_dev.dev.parent		= mdev->device;
 	dev->ib_dev.lag_flags		= RDMA_LAG_FLAGS_HASH_ALL_SLAVES;

+	err = init_srcu_struct(&dev->odp_srcu);
+	if (err)
+		goto err_mp;
+
 	mutex_init(&dev->cap_mask_mutex);
 	INIT_LIST_HEAD(&dev->qp_list);
 	spin_lock_init(&dev->reset_flow_resource_lock);
@@ -4011,11 +4015,6 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)

 	spin_lock_init(&dev->dm.lock);
 	dev->dm.dev = mdev;
-
-	err = init_srcu_struct(&dev->odp_srcu);
-	if (err)
-		goto err_mp;
-
 	return 0;

 err_mp:
--
2.29.2


  parent reply	other threads:[~2021-01-13 12:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 12:16 [PATCH rdma-next 0/5] Set of fixes Leon Romanovsky
2021-01-13 12:16 ` [PATCH rdma-next 1/5] RDMA/umem: Avoid undefined behavior of rounddown_pow_of_two Leon Romanovsky
2021-01-13 12:17 ` [PATCH rdma-next 2/5] IB/mlx5: Fix error unwinding when set_has_smi_cap fails Leon Romanovsky
2021-01-13 12:17 ` Leon Romanovsky [this message]
2021-01-13 12:17 ` [PATCH rdma-next 4/5] IB/mlx5: Make function static Leon Romanovsky
2021-01-13 12:17 ` [PATCH rdma-next 5/5] RDMA/mlx5: Fix wrong free of blue flame register on error Leon Romanovsky
2021-01-14 17:04 ` [PATCH rdma-next 0/5] Set of fixes Jason Gunthorpe
2021-01-14 17:36   ` Leon Romanovsky
2021-01-20  0:15 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210113121703.559778-4-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=aharonl@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@mellanox.com \
    --cc=mbloch@nvidia.com \
    --cc=parav@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).