diff mbox series

aio: Fix an error code in __io_submit_one()

Message ID 20190403062235.GA1343@kadam (mailing list archive)
State New, archived
Headers show
Series aio: Fix an error code in __io_submit_one() | expand

Commit Message

Dan Carpenter April 3, 2019, 6:22 a.m. UTC
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>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Al Viro April 3, 2019, 4:46 p.m. UTC | #1
On Wed, Apr 03, 2019 at 09:22:35AM +0300, Dan Carpenter wrote:
> This accidentally returns the wrong variable.  The "req->ki_eventfd"
> pointer is NULL so this return success.

Applied.
diff mbox series

Patch

diff --git a/fs/aio.c b/fs/aio.c
index a4cc2a1cccb7..7ccecaab487a 100644
--- 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;
 	}