Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77f76013 authored by Ganapathi CH's avatar Ganapathi CH Committed by Roland Dreier
Browse files

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: default avatarRoland Dreier <rolandd@cisco.com>
parent ca222c6b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);