IB/uverbs: Release lock on error path

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>
This commit is contained in:
Ganapathi CH 2006-06-17 20:37:40 -07:00 committed by Roland Dreier
parent ca222c6b2c
commit 77f76013e3
1 changed files with 4 additions and 2 deletions

View File

@ -80,8 +80,10 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
in_len - sizeof cmd, out_len - sizeof resp); in_len - sizeof cmd, out_len - sizeof resp);
ucontext = ibdev->alloc_ucontext(ibdev, &udata); ucontext = ibdev->alloc_ucontext(ibdev, &udata);
if (IS_ERR(ucontext)) if (IS_ERR(ucontext)) {
return PTR_ERR(file->ucontext); ret = PTR_ERR(file->ucontext);
goto err;
}
ucontext->device = ibdev; ucontext->device = ibdev;
INIT_LIST_HEAD(&ucontext->pd_list); INIT_LIST_HEAD(&ucontext->pd_list);