[PATCH next] io_uring/rsrc: Fix an IS_ERR() vs NULL bug in io_install_fixed_file()

Dan Carpenter posted 1 patch 3 weeks, 4 days ago
io_uring/filetable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH next] io_uring/rsrc: Fix an IS_ERR() vs NULL bug in io_install_fixed_file()
Posted by Dan Carpenter 3 weeks, 4 days ago
The io_rsrc_node_alloc() function returns NULL on error, it doesn't
return error pointers.  Update the error checking to match.

Fixes: ead12caeb8ac ("io_uring/rsrc: get rid of per-ring io_rsrc_node list")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 io_uring/filetable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/filetable.c b/io_uring/filetable.c
index 78e77e2017be..fc6872304136 100644
--- a/io_uring/filetable.c
+++ b/io_uring/filetable.c
@@ -69,7 +69,7 @@ static int io_install_fixed_file(struct io_ring_ctx *ctx, struct file *file,
 
 	node = io_rsrc_node_alloc(ctx, &ctx->file_table.data, slot_index,
 				  IORING_RSRC_FILE);
-	if (IS_ERR(node))
+	if (!node)
 		return -ENOMEM;
 
 	old_node = io_rsrc_node_lookup(&ctx->file_table.data, &slot_index);
-- 
2.45.2
Re: [PATCH next] io_uring/rsrc: Fix an IS_ERR() vs NULL bug in io_install_fixed_file()
Posted by Jens Axboe 3 weeks, 4 days ago
On Wed, 30 Oct 2024 12:54:52 +0300, Dan Carpenter wrote:
> The io_rsrc_node_alloc() function returns NULL on error, it doesn't
> return error pointers.  Update the error checking to match.
> 
> 

Applied, thanks!

[1/1] io_uring/rsrc: Fix an IS_ERR() vs NULL bug in io_install_fixed_file()
      commit: 9b79509ce43370ceaf582bbf752aaeee9d40c9e0

Best regards,
-- 
Jens Axboe