rxrpc: Return negative error code to kernel service
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Oct 2016 07:11:50 +0000 (08:11 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 6 Oct 2016 07:11:50 +0000 (08:11 +0100)
In rxrpc_kernel_recv_data(), when we return the error number incurred by a
failed call, we must negate it before returning it as it's stored as
positive (that's what we have to pass back to userspace).

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/recvmsg.c

index 3fa7771c2a9da0904f7cd7b6d27036acf82ac36d..db5b02a475189cfd682602f88480180101fb48a2 100644 (file)
@@ -652,7 +652,7 @@ excess_data:
        goto out;
 call_complete:
        *_abort = call->abort_code;
-       ret = call->error;
+       ret = -call->error;
        if (call->completion == RXRPC_CALL_SUCCEEDED) {
                ret = 1;
                if (size > 0)