All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	<linuxarm@huawei.com>, Weihang Li <liweihang@huawei.com>
Subject: [PATCH v2 for-next 7/7] RDMA/core: Remove redundant BUG_ON
Date: Wed, 7 Apr 2021 16:15:53 +0800	[thread overview]
Message-ID: <1617783353-48249-8-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1617783353-48249-1-git-send-email-liweihang@huawei.com>

It's ok if the refcount of cm_id is zero when release the reference of it,
there is no need to call BUG_ON.

Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/core/iwcm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index da8adad..654ac72 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -211,7 +211,6 @@ static void free_cm_id(struct iwcm_id_private *cm_id_priv)
  */
 static int iwcm_deref_id(struct iwcm_id_private *cm_id_priv)
 {
-	BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
 	if (atomic_dec_and_test(&cm_id_priv->refcount)) {
 		BUG_ON(!list_empty(&cm_id_priv->work_list));
 		free_cm_id(cm_id_priv);
-- 
2.8.1


  parent reply	other threads:[~2021-04-07  8:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  8:15 [PATCH v2 for-next 0/7] RDMA/core: Correct some coding-style issues Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 1/7] RDMA/core: Print the function name by __func__ instead of an fixed string Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 2/7] RDMA/core: Remove the redundant return statements Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 3/7] RDMA/core: Add necessary spaces Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 4/7] RDMA/core: Remove redundant spaces Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 5/7] RDMA/core: Correct format of braces Weihang Li
2021-04-07  8:15 ` [PATCH v2 for-next 6/7] RDMA/core: Correct format of block comments Weihang Li
2021-04-07  8:15 ` Weihang Li [this message]
2021-04-12 17:51   ` [PATCH v2 for-next 7/7] RDMA/core: Remove redundant BUG_ON Jason Gunthorpe
2021-04-13  3:46     ` liweihang
2021-04-07 12:26 ` [PATCH v2 for-next 0/7] RDMA/core: Correct some coding-style issues Leon Romanovsky
2021-04-12 17:59 ` Jason Gunthorpe
2021-04-13  2:37   ` liweihang

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=1617783353-48249-8-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.