mirror of
https://github.com/torvalds/linux.git
synced 2024-12-18 00:53:40 +00:00
IB/qib: Fix for broken sparse warning fix
Commit 1fb9fed6d4
("IB/qib: Fix QP RCU sparse warning") broke QP
hash list deletion in qp_remove() badly.
This patch restores the former for loop behavior, while still fixing
the sparse warnings.
Cc: <stable@vger.kernel.org>
Reviewed-by: Gary Leshner <gary.s.leshner@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
949db153b6
commit
d359f35430
@ -263,20 +263,15 @@ static void remove_qp(struct qib_ibdev *dev, struct qib_qp *qp)
|
|||||||
struct qib_qp __rcu **qpp;
|
struct qib_qp __rcu **qpp;
|
||||||
|
|
||||||
qpp = &dev->qp_table[n];
|
qpp = &dev->qp_table[n];
|
||||||
q = rcu_dereference_protected(*qpp,
|
for (; (q = rcu_dereference_protected(*qpp,
|
||||||
lockdep_is_held(&dev->qpt_lock));
|
lockdep_is_held(&dev->qpt_lock))) != NULL;
|
||||||
for (; q; qpp = &q->next) {
|
qpp = &q->next)
|
||||||
if (q == qp) {
|
if (q == qp) {
|
||||||
atomic_dec(&qp->refcount);
|
atomic_dec(&qp->refcount);
|
||||||
*qpp = qp->next;
|
*qpp = qp->next;
|
||||||
rcu_assign_pointer(qp->next, NULL);
|
rcu_assign_pointer(qp->next, NULL);
|
||||||
q = rcu_dereference_protected(*qpp,
|
|
||||||
lockdep_is_held(&dev->qpt_lock));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
q = rcu_dereference_protected(*qpp,
|
|
||||||
lockdep_is_held(&dev->qpt_lock));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&dev->qpt_lock, flags);
|
spin_unlock_irqrestore(&dev->qpt_lock, flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user