Skip to content

Commit

Permalink
IB/uverbs: Don't decrement usecnt on error paths
Browse files Browse the repository at this point in the history
In error paths when destroying an object, uverbs should not decrement
associated objects' usecnt, since ib_dereg_mr(), ib_destroy_qp(),
etc. already do that.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Jun 18, 2006
1 parent 77f7601 commit 92b1582
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,

err_unreg:
ib_dereg_mr(mr);
atomic_dec(&pd->usecnt);

err_up:
mutex_unlock(&ib_uverbs_idr_mutex);
Expand Down Expand Up @@ -986,11 +985,6 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,

err_destroy:
ib_destroy_qp(qp);
atomic_dec(&pd->usecnt);
atomic_dec(&attr.send_cq->usecnt);
atomic_dec(&attr.recv_cq->usecnt);
if (attr.srq)
atomic_dec(&attr.srq->usecnt);

err_up:
mutex_unlock(&ib_uverbs_idr_mutex);
Expand Down Expand Up @@ -1888,7 +1882,6 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,

err_destroy:
ib_destroy_srq(srq);
atomic_dec(&pd->usecnt);

err_up:
mutex_unlock(&ib_uverbs_idr_mutex);
Expand Down

0 comments on commit 92b1582

Please sign in to comment.