diff mbox series

[5/8] aio: fix failure to put the file pointer

Message ID 20181120171953.1258-6-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show
Series [1/8] fs: add file_operations ->iopoll() handler | expand

Commit Message

Jens Axboe Nov. 20, 2018, 5:19 p.m. UTC
If the ioprio capability check fails, we return without putting
the file pointer.

Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/aio.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/fs/aio.c b/fs/aio.c
index 574a14b43037..611e9824279d 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1436,6 +1436,7 @@  static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
 		ret = ioprio_check_cap(iocb->aio_reqprio);
 		if (ret) {
 			pr_debug("aio ioprio check cap error: %d\n", ret);
+			fput(req->ki_filp);
 			return ret;
 		}