Commit fc7222c3 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/msg_ring: check file type before putting



If we're invoked with a fixed file, follow the normal rules of not
calling io_fput_file(). Fixed files are permanently registered to the
ring, and do not need putting separately.

Cc: stable@vger.kernel.org
Fixes: aa184e86 ("io_uring: don't attempt to IOPOLL for MSG_RING requests")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 62bb0647
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
		req_set_fail(req);
	io_req_set_res(req, ret, 0);
	/* put file to avoid an attempt to IOPOLL the req */
	if (!(req->flags & REQ_F_FIXED_FILE))
		io_put_file(req->file);
	req->file = NULL;
	return IOU_OK;