public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix unchecked error in switch_start()
@ 2021-04-29 10:46 Pavel Begunkov
  2021-04-29 14:26 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-04-29 10:46 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: syzbot+a4715dd4b7c866136f79

io_rsrc_node_switch_start() can fail, don't forget to check returned
error code.

Reported-by: [email protected]
Fixes: eae071c9b4cef ("io_uring: prepare fixed rw for dynanic buffers")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 43b00077dbd3..fe549b58fa64 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -9624,7 +9624,9 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
 	if (ret)
 		goto err;
 	/* always set a rsrc node */
-	io_rsrc_node_switch_start(ctx);
+	ret = io_rsrc_node_switch_start(ctx);
+	if (ret)
+		goto err;
 	io_rsrc_node_switch(ctx, NULL);
 
 	memset(&p->sq_off, 0, sizeof(p->sq_off));
-- 
2.31.1


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

end of thread, other threads:[~2021-04-29 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-29 10:46 [PATCH] io_uring: fix unchecked error in switch_start() Pavel Begunkov
2021-04-29 14:26 ` Jens Axboe

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