diff options
author | Ganapathi CH <cganapathi@novell.com> | 2006-06-17 20:37:40 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-06-17 20:37:40 -0700 |
commit | 77f76013e3ffda605b20184db5862ce1efcb6f5a (patch) | |
tree | ce0c5fb39d891027e2609f74a160eb54b15dce37 /drivers/infiniband | |
parent | ca222c6b2c48e1e0be330a55611ba394251330cb (diff) | |
download | op-kernel-dev-77f76013e3ffda605b20184db5862ce1efcb6f5a.zip op-kernel-dev-77f76013e3ffda605b20184db5862ce1efcb6f5a.tar.gz |
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 9f69bd48..4266d2e 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -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); |