IB/qib: Correct reference counting in debugfs qp_stats
This particular reference count is not needed with the rcu protection, and the current code leaks a reference count, causing a hang in qib_qp_destroy(). Cc: <stable@vger.kernel.org> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:

committed by
Roland Dreier

parent
f5c4984e06
commit
85cbb7c728
@@ -1325,7 +1325,6 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
|
||||
struct qib_qp *pqp = iter->qp;
|
||||
struct qib_qp *qp;
|
||||
|
||||
rcu_read_lock();
|
||||
for (; n < dev->qp_table_size; n++) {
|
||||
if (pqp)
|
||||
qp = rcu_dereference(pqp->next);
|
||||
@@ -1333,18 +1332,11 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
|
||||
qp = rcu_dereference(dev->qp_table[n]);
|
||||
pqp = qp;
|
||||
if (qp) {
|
||||
if (iter->qp)
|
||||
atomic_dec(&iter->qp->refcount);
|
||||
atomic_inc(&qp->refcount);
|
||||
rcu_read_unlock();
|
||||
iter->qp = qp;
|
||||
iter->n = n;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
if (iter->qp)
|
||||
atomic_dec(&iter->qp->refcount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user