rxrpc: Don't release call mutex on error pointer
Don't release call mutex at the end of rxrpc_kernel_begin_call() if the
call pointer actually holds an error value.
Fixes: 540b1c48c3
("rxrpc: Fix deadlock between call creation and sendmsg/recvmsg")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
748759d57e
commit
6cb3ece968
1 changed files with 3 additions and 2 deletions
|
@ -308,10 +308,11 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
|
||||||
call = rxrpc_new_client_call(rx, &cp, srx, user_call_ID, tx_total_len,
|
call = rxrpc_new_client_call(rx, &cp, srx, user_call_ID, tx_total_len,
|
||||||
gfp);
|
gfp);
|
||||||
/* The socket has been unlocked. */
|
/* The socket has been unlocked. */
|
||||||
if (!IS_ERR(call))
|
if (!IS_ERR(call)) {
|
||||||
call->notify_rx = notify_rx;
|
call->notify_rx = notify_rx;
|
||||||
|
mutex_unlock(&call->user_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&call->user_mutex);
|
|
||||||
_leave(" = %p", call);
|
_leave(" = %p", call);
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue