rxrpc: Don't negate call->error before returning it
call->error is stored as 0 or a negative error code. Don't negate this value (ie. make it positive) before returning it from a kernel function (though it should still be negated before passing to userspace through a control message). Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
@@ -61,7 +61,7 @@ static int rxrpc_wait_for_tx_window(struct rxrpc_sock *rx,
|
|||||||
call->cong_cwnd + call->cong_extra))
|
call->cong_cwnd + call->cong_extra))
|
||||||
break;
|
break;
|
||||||
if (call->state >= RXRPC_CALL_COMPLETE) {
|
if (call->state >= RXRPC_CALL_COMPLETE) {
|
||||||
ret = -call->error;
|
ret = call->error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (signal_pending(current)) {
|
if (signal_pending(current)) {
|
||||||
@@ -364,8 +364,8 @@ out:
|
|||||||
|
|
||||||
call_terminated:
|
call_terminated:
|
||||||
rxrpc_free_skb(skb, rxrpc_skb_tx_freed);
|
rxrpc_free_skb(skb, rxrpc_skb_tx_freed);
|
||||||
_leave(" = %d", -call->error);
|
_leave(" = %d", call->error);
|
||||||
return -call->error;
|
return call->error;
|
||||||
|
|
||||||
maybe_error:
|
maybe_error:
|
||||||
if (copied)
|
if (copied)
|
||||||
@@ -660,7 +660,7 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
|
|||||||
break;
|
break;
|
||||||
case RXRPC_CALL_COMPLETE:
|
case RXRPC_CALL_COMPLETE:
|
||||||
read_lock_bh(&call->state_lock);
|
read_lock_bh(&call->state_lock);
|
||||||
ret = -call->error;
|
ret = call->error;
|
||||||
read_unlock_bh(&call->state_lock);
|
read_unlock_bh(&call->state_lock);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user