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@xxxxxxxxxx> --- 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