]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
aio: Fix an error code in __io_submit_one()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Apr 2019 06:22:35 +0000 (09:22 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 3 Apr 2019 16:47:36 +0000 (12:47 -0400)
This accidentally returns the wrong variable.  The "req->ki_eventfd"
pointer is NULL so this return success.

Fixes: 7316b49c2a11 ("aio: move sanity checks and request allocation to io_submit_one()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/aio.c

index a4cc2a1cccb7516216b23c4fe34431996616e3c3..7ccecaab487a16ffc33d4a8331398d047f2aaa82 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1794,7 +1794,7 @@ static int __io_submit_one(struct kioctx *ctx, const struct iocb *iocb,
                 */
                eventfd = eventfd_ctx_fdget(iocb->aio_resfd);
                if (IS_ERR(eventfd))
-                       return PTR_ERR(req->ki_eventfd);
+                       return PTR_ERR(eventfd);
 
                req->ki_eventfd = eventfd;
        }