Skip to contentSkip to conversation

io_uring/zcrx: fix leaks on failed registration

PATCH Applied Pavel Begunkov 2 participants 2 messages Feb 19, 2025

Subsystems (2)
lore
Share & tools
lore

Pavel Begunkov

author maintainer
#0 lore raw

PATCH 1/1 io_uring/zcrx: fix leaks on failed registration

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.

---
 io_uring/zcrx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/zcrx.c +2 -1
index a9eaab3fccf2..f2d326e18e67 100644
@@ -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);
Signature · 1 line
2.48.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Pavel Begunkov

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.

Applied, thanks!

[1/1] io_uring/zcrx: fix leaks on failed registration

      commit: f6977b06c598eab1db7416476452cf260208dbb0

Best regards,

Signature · 1 line
Jens Axboe