Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 754320d6 authored by Leon Yu's avatar Leon Yu Committed by Benjamin LaHaise
Browse files

aio: fix potential leak in aio_run_iocb().



iovec should be reclaimed whenever caller of rw_copy_check_uvector() returns,
but it doesn't hold when failure happens right after aio_setup_vectored_rw().

Fix that in a such way to avoid hairy goto.

Signed-off-by: default avatarLeon Yu <chianglungyu@gmail.com>
Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
Cc: stable@vger.kernel.org
parent e02ba72a
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1327,9 +1327,7 @@ rw_common:
						&iovec, compat)
			: aio_setup_single_vector(req, rw, buf, &nr_segs,
						  iovec);
		if (ret)
			return ret;

		if (!ret)
			ret = rw_verify_area(rw, file, &req->ki_pos, req->ki_nbytes);
		if (ret < 0) {
			if (iovec != &inline_vec)