public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring/region: fix error codes after failed vmap
@ 2024-11-17  0:38 Pavel Begunkov
  2024-11-17 16:01 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2024-11-17  0:38 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

io_create_region() jumps after a vmap failure without setting the return
code, it could be 0 or just uninitialised.

Fixes: dfbbfbf191878 ("io_uring: introduce concept of memory regions")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/memmap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/io_uring/memmap.c b/io_uring/memmap.c
index bbd9569a0120..6e6ee79ba94f 100644
--- a/io_uring/memmap.c
+++ b/io_uring/memmap.c
@@ -247,8 +247,10 @@ int io_create_region(struct io_ring_ctx *ctx, struct io_mapped_region *mr,
 	}
 
 	vptr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL);
-	if (!vptr)
+	if (!vptr) {
+		ret = -ENOMEM;
 		goto out_free;
+	}
 
 	mr->pages = pages;
 	mr->vmap_ptr = vptr;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] io_uring/region: fix error codes after failed vmap
  2024-11-17  0:38 [PATCH 1/1] io_uring/region: fix error codes after failed vmap Pavel Begunkov
@ 2024-11-17 16:01 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2024-11-17 16:01 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov


On Sun, 17 Nov 2024 00:38:33 +0000, Pavel Begunkov wrote:
> io_create_region() jumps after a vmap failure without setting the return
> code, it could be 0 or just uninitialised.
> 
> 

Applied, thanks!

[1/1] io_uring/region: fix error codes after failed vmap
      commit: a652958888fb1ada3e4f6b548576c2d2c1b60d66

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-17 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17  0:38 [PATCH 1/1] io_uring/region: fix error codes after failed vmap Pavel Begunkov
2024-11-17 16:01 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox