aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/sendmsg.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-08-29 05:18:43 -0400
committerDavid Howells <dhowells@redhat.com>2017-08-29 05:55:20 -0400
commitbd2db2d231b4a9daccdba6712c3113e650260c6c (patch)
tree6eb87644236dfd48d5e8c62d2fdf1d9f87c3b079 /net/rxrpc/sendmsg.c
parent7b674e390e513ea443c5a0f27ec95e93fb8a94fa (diff)
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>
Diffstat (limited to 'net/rxrpc/sendmsg.c')
-rw-r--r--net/rxrpc/sendmsg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index b0d2cda6ec0a..bc7f0241d92b 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -61,7 +61,7 @@ static int rxrpc_wait_for_tx_window(struct rxrpc_sock *rx,
61 call->cong_cwnd + call->cong_extra)) 61 call->cong_cwnd + call->cong_extra))
62 break; 62 break;
63 if (call->state >= RXRPC_CALL_COMPLETE) { 63 if (call->state >= RXRPC_CALL_COMPLETE) {
64 ret = -call->error; 64 ret = call->error;
65 break; 65 break;
66 } 66 }
67 if (signal_pending(current)) { 67 if (signal_pending(current)) {
@@ -364,8 +364,8 @@ out:
364 364
365call_terminated: 365call_terminated:
366 rxrpc_free_skb(skb, rxrpc_skb_tx_freed); 366 rxrpc_free_skb(skb, rxrpc_skb_tx_freed);
367 _leave(" = %d", -call->error); 367 _leave(" = %d", call->error);
368 return -call->error; 368 return call->error;
369 369
370maybe_error: 370maybe_error:
371 if (copied) 371 if (copied)
@@ -660,7 +660,7 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
660 break; 660 break;
661 case RXRPC_CALL_COMPLETE: 661 case RXRPC_CALL_COMPLETE:
662 read_lock_bh(&call->state_lock); 662 read_lock_bh(&call->state_lock);
663 ret = -call->error; 663 ret = call->error;
664 read_unlock_bh(&call->state_lock); 664 read_unlock_bh(&call->state_lock);
665 break; 665 break;
666 default: 666 default: