diff options
| -rw-r--r-- | net/rxrpc/sendmsg.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 31c1538c1a8d..27685d8cba1a 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c | |||
| @@ -517,13 +517,6 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) | |||
| 517 | ret = -EBADSLT; | 517 | ret = -EBADSLT; |
| 518 | if (cmd != RXRPC_CMD_SEND_DATA) | 518 | if (cmd != RXRPC_CMD_SEND_DATA) |
| 519 | goto error_release_sock; | 519 | goto error_release_sock; |
| 520 | ret = -EBUSY; | ||
| 521 | if (call->state == RXRPC_CALL_UNINITIALISED || | ||
| 522 | call->state == RXRPC_CALL_CLIENT_AWAIT_CONN || | ||
| 523 | call->state == RXRPC_CALL_SERVER_PREALLOC || | ||
| 524 | call->state == RXRPC_CALL_SERVER_SECURING || | ||
| 525 | call->state == RXRPC_CALL_SERVER_ACCEPTING) | ||
| 526 | goto error_release_sock; | ||
| 527 | call = rxrpc_new_client_call_for_sendmsg(rx, msg, user_call_ID, | 520 | call = rxrpc_new_client_call_for_sendmsg(rx, msg, user_call_ID, |
| 528 | exclusive); | 521 | exclusive); |
| 529 | /* The socket is now unlocked... */ | 522 | /* The socket is now unlocked... */ |
| @@ -531,6 +524,14 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) | |||
| 531 | return PTR_ERR(call); | 524 | return PTR_ERR(call); |
| 532 | /* ... and we have the call lock. */ | 525 | /* ... and we have the call lock. */ |
| 533 | } else { | 526 | } else { |
| 527 | ret = -EBUSY; | ||
| 528 | if (call->state == RXRPC_CALL_UNINITIALISED || | ||
| 529 | call->state == RXRPC_CALL_CLIENT_AWAIT_CONN || | ||
| 530 | call->state == RXRPC_CALL_SERVER_PREALLOC || | ||
| 531 | call->state == RXRPC_CALL_SERVER_SECURING || | ||
| 532 | call->state == RXRPC_CALL_SERVER_ACCEPTING) | ||
| 533 | goto error_release_sock; | ||
| 534 | |||
| 534 | ret = mutex_lock_interruptible(&call->user_mutex); | 535 | ret = mutex_lock_interruptible(&call->user_mutex); |
| 535 | release_sock(&rx->sk); | 536 | release_sock(&rx->sk); |
| 536 | if (ret < 0) { | 537 | if (ret < 0) { |
