]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/splice.c
Merge v5.3-rc1 into drm-misc-next
[linux.git] / fs / splice.c
index 25212dcca2dfd6b43dc51cd8887f93038c753515..98412721f0562c3e2f20332e28f756df6eddc7a1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * "splice": joining two ropes together by interweaving their strands.
  *
@@ -1355,7 +1356,7 @@ SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, uiov,
        struct iovec iovstack[UIO_FASTIOV];
        struct iovec *iov = iovstack;
        struct iov_iter iter;
-       long error;
+       ssize_t error;
        struct fd f;
        int type;
 
@@ -1366,7 +1367,7 @@ SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, uiov,
 
        error = import_iovec(type, uiov, nr_segs,
                             ARRAY_SIZE(iovstack), &iov, &iter);
-       if (!error) {
+       if (error >= 0) {
                error = do_vmsplice(f.file, &iter, flags);
                kfree(iov);
        }
@@ -1381,7 +1382,7 @@ COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, io
        struct iovec iovstack[UIO_FASTIOV];
        struct iovec *iov = iovstack;
        struct iov_iter iter;
-       long error;
+       ssize_t error;
        struct fd f;
        int type;
 
@@ -1392,7 +1393,7 @@ COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, io
 
        error = compat_import_iovec(type, iov32, nr_segs,
                             ARRAY_SIZE(iovstack), &iov, &iter);
-       if (!error) {
+       if (error >= 0) {
                error = do_vmsplice(f.file, &iter, flags);
                kfree(iov);
        }