* [PATCH 1/1] io_uring/zcrx: fix leaks on failed registration
@ 2025-02-19 10:09 Pavel Begunkov
2025-02-19 15:07 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-02-19 10:09 UTC (permalink / raw)
To: io-uring; +Cc: asml.silence, kernel test robot, Dan Carpenter
If we try to register a device-less interface like veth,
io_register_zcrx_ifq() will leak struct io_zcrx_ifq with a bunch of
resources attached to it. Fix that.
Fixes: 9fd13751abf5f ("io_uring/zcrx: grab a net device")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/zcrx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index a9eaab3fccf2..f2d326e18e67 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -388,8 +388,9 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
goto err;
ifq->dev = ifq->netdev->dev.parent;
+ ret = -EOPNOTSUPP;
if (!ifq->dev)
- return -EOPNOTSUPP;
+ goto err;
get_device(ifq->dev);
ret = io_zcrx_map_area(ifq, ifq->area);
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-19 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 10:09 [PATCH 1/1] io_uring/zcrx: fix leaks on failed registration Pavel Begunkov
2025-02-19 15:07 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox