aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2016-12-07 22:33:46 -0500
committerDoug Ledford <dledford@redhat.com>2016-12-11 15:29:42 -0500
commitb44980f8794faf3561d970fe8c05e34765fbdc9b (patch)
tree77c47a320482f91ad4ba56fd5237d1a4ed4afb53 /drivers/infiniband/sw
parent008016746720d4295e38e940e22dbd116c90c95b (diff)
IB/hfi1: Replace qp->refcount release code with standard driver wrapper
Some parts of the code don't use the standard release wrapper rvt_put_qp() for decrementing and testing the refcount to then try to use a resource. Replace this code with the standard driver wrapper. Fixes: Commit 4d6f85c3fa55 ("IB/rdmavt, IB/qib, IB/hfi1: Use new QP put get routines") Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rdmavt/mcast.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c
index 983d319ac976..05c8c2afb0e3 100644
--- a/drivers/infiniband/sw/rdmavt/mcast.c
+++ b/drivers/infiniband/sw/rdmavt/mcast.c
@@ -81,7 +81,7 @@ static struct rvt_mcast_qp *rvt_mcast_qp_alloc(struct rvt_qp *qp)
81 goto bail; 81 goto bail;
82 82
83 mqp->qp = qp; 83 mqp->qp = qp;
84 atomic_inc(&qp->refcount); 84 rvt_get_qp(qp);
85 85
86bail: 86bail:
87 return mqp; 87 return mqp;
@@ -92,8 +92,7 @@ static void rvt_mcast_qp_free(struct rvt_mcast_qp *mqp)
92 struct rvt_qp *qp = mqp->qp; 92 struct rvt_qp *qp = mqp->qp;
93 93
94 /* Notify hfi1_destroy_qp() if it is waiting. */ 94 /* Notify hfi1_destroy_qp() if it is waiting. */
95 if (atomic_dec_and_test(&qp->refcount)) 95 rvt_put_qp(qp);
96 wake_up(&qp->wait);
97 96
98 kfree(mqp); 97 kfree(mqp);
99} 98}