Skip to content

Commit

Permalink
rxrpc: The mutex lock returned by rxrpc_accept_call() needs releasing
Browse files Browse the repository at this point in the history
[ Upstream commit 03a6c82 ]

The caller of rxrpc_accept_call() must release the lock on call->user_mutex
returned by that function.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
dhowells authored and gregkh committed Feb 3, 2018
1 parent e2443fb commit 92c131b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/rxrpc/sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
/* The socket is now unlocked. */
if (IS_ERR(call))
return PTR_ERR(call);
rxrpc_put_call(call, rxrpc_call_put);
return 0;
ret = 0;
goto out_put_unlock;
}

call = rxrpc_find_call_by_user_ID(rx, p.user_call_ID);
Expand Down Expand Up @@ -633,6 +633,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
ret = rxrpc_send_data(rx, call, msg, len, NULL);
}

out_put_unlock:
mutex_unlock(&call->user_mutex);
error_put:
rxrpc_put_call(call, rxrpc_call_put);
Expand Down

0 comments on commit 92c131b

Please sign in to comment.