]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/io_uring.c
Merge branch 'drm-fixes-5.2' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
[linux.git] / fs / io_uring.c
index 383d208ca0d2135774b2b1510353ff17f6704bad..0fbb486a320e927bb47aa1ac63fcea6ef6284760 100644 (file)
@@ -2616,7 +2616,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
 
                ret = io_copy_iov(ctx, &iov, arg, i);
                if (ret)
-                       break;
+                       goto err;
 
                /*
                 * Don't impose further limits on the size and buffer
@@ -2671,8 +2671,9 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
 
                ret = 0;
                down_read(&current->mm->mmap_sem);
-               pret = get_user_pages_longterm(ubuf, nr_pages, FOLL_WRITE,
-                                               pages, vmas);
+               pret = get_user_pages(ubuf, nr_pages,
+                                     FOLL_WRITE | FOLL_LONGTERM,
+                                     pages, vmas);
                if (pret == nr_pages) {
                        /* don't support file backed memory */
                        for (j = 0; j < nr_pages; j++) {