summaryrefslogtreecommitdiffstats
path: root/net/compat.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-05-14 18:02:22 -0400
committerJens Axboe <axboe@kernel.dk>2019-05-31 17:30:03 -0400
commit87e5e6dab6c2a21fab2620f37786276d202e2ce0 (patch)
tree617496186deb33cc30c77506130bc21973c77710 /net/compat.c
parent61939b12dc24d0ac958020f261046c35a16e0c48 (diff)
uio: make import_iovec()/compat_import_iovec() return bytes on success
Currently these functions return < 0 on error, and 0 for success. Change that so that we return < 0 on error, but number of bytes for success. Some callers already treat the return value that way, others need a slight tweak. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'net/compat.c')
-rw-r--r--net/compat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/compat.c b/net/compat.c
index 3f9ce609397f..0f7ded26059e 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -80,9 +80,10 @@ int get_compat_msghdr(struct msghdr *kmsg,
80 80
81 kmsg->msg_iocb = NULL; 81 kmsg->msg_iocb = NULL;
82 82
83 return compat_import_iovec(save_addr ? READ : WRITE, 83 err = compat_import_iovec(save_addr ? READ : WRITE,
84 compat_ptr(msg.msg_iov), msg.msg_iovlen, 84 compat_ptr(msg.msg_iov), msg.msg_iovlen,
85 UIO_FASTIOV, iov, &kmsg->msg_iter); 85 UIO_FASTIOV, iov, &kmsg->msg_iter);
86 return err < 0 ? err : 0;
86} 87}
87 88
88/* Bleech... */ 89/* Bleech... */