Skip to content

Commit

Permalink
IB/uverbs: Release lock on error path
Browse files Browse the repository at this point in the history
If ibdev->alloc_ucontext() fails then ib_uverbs_get_context() does not
unlock file->mutex before returning error.

Signed-off by: Ganapathi CH <cganapathi@novell.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Ganapathi CH authored and Roland Dreier committed Jun 18, 2006
1 parent ca222c6 commit 77f7601
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
in_len - sizeof cmd, out_len - sizeof resp);

ucontext = ibdev->alloc_ucontext(ibdev, &udata);
if (IS_ERR(ucontext))
return PTR_ERR(file->ucontext);
if (IS_ERR(ucontext)) {
ret = PTR_ERR(file->ucontext);
goto err;
}

ucontext->device = ibdev;
INIT_LIST_HEAD(&ucontext->pd_list);
Expand Down

0 comments on commit 77f7601

Please sign in to comment.