diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-24 01:52:47 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-24 01:52:47 -0400 |
commit | 23930fa1cebfea6f79881c588ccd1b0781e49e3f (patch) | |
tree | 36d29e3f83661c4f5f45b6f74ac0d5f9886867a8 /drivers/infiniband/hw/ipath/ipath_verbs_mcast.c | |
parent | 36b35a5be0e4b406acd816e2122d153e875105be (diff) | |
parent | 4f5537de7c1531398e84e18a24f667e49cc94208 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs_mcast.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs_mcast.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c b/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c index ee0e1d96d723..085e28b939ec 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c | |||
@@ -207,12 +207,17 @@ static int ipath_mcast_add(struct ipath_ibdev *dev, | |||
207 | goto bail; | 207 | goto bail; |
208 | } | 208 | } |
209 | 209 | ||
210 | spin_lock(&dev->n_mcast_grps_lock); | ||
210 | if (dev->n_mcast_grps_allocated == ib_ipath_max_mcast_grps) { | 211 | if (dev->n_mcast_grps_allocated == ib_ipath_max_mcast_grps) { |
212 | spin_unlock(&dev->n_mcast_grps_lock); | ||
211 | ret = ENOMEM; | 213 | ret = ENOMEM; |
212 | goto bail; | 214 | goto bail; |
213 | } | 215 | } |
214 | 216 | ||
215 | dev->n_mcast_grps_allocated++; | 217 | dev->n_mcast_grps_allocated++; |
218 | spin_unlock(&dev->n_mcast_grps_lock); | ||
219 | |||
220 | mcast->n_attached++; | ||
216 | 221 | ||
217 | list_add_tail_rcu(&mqp->list, &mcast->qp_list); | 222 | list_add_tail_rcu(&mqp->list, &mcast->qp_list); |
218 | 223 | ||
@@ -343,7 +348,9 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) | |||
343 | atomic_dec(&mcast->refcount); | 348 | atomic_dec(&mcast->refcount); |
344 | wait_event(mcast->wait, !atomic_read(&mcast->refcount)); | 349 | wait_event(mcast->wait, !atomic_read(&mcast->refcount)); |
345 | ipath_mcast_free(mcast); | 350 | ipath_mcast_free(mcast); |
351 | spin_lock(&dev->n_mcast_grps_lock); | ||
346 | dev->n_mcast_grps_allocated--; | 352 | dev->n_mcast_grps_allocated--; |
353 | spin_unlock(&dev->n_mcast_grps_lock); | ||
347 | } | 354 | } |
348 | 355 | ||
349 | ret = 0; | 356 | ret = 0; |