Skip to contentSkip to conversation

io_uring: fix uninitialized error code in io_eventfd_register()

PATCH New Dan Carpenter 1 participant 1 message Feb 8, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fix uninitialized error code in io_eventfd_register()

The "ret" variable isn't initialized. We should just return 0.

Fixes b77e315a9644 ("io_uring: avoid ring quiesce while registering/unregistering eventfd")
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index aadabb31d6da..74afb96af214 100644
@@ -9393,7 +9393,7 @@ static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,
 	ev_fd->eventfd_async = eventfd_async;
 
 	rcu_assign_pointer(ctx->io_ev_fd, ev_fd);
-	return ret;
+	return 0;
 }
 
 static void io_eventfd_put(struct rcu_head *rcu)
Signature · 1 line
2.20.1