Skip to content

Commit 8a519a5

Browse files
LiangChen77kuba-moo
authored andcommitted
net: veth: Page pool creation error handling for existing pools only
The failure handling procedure destroys page pools for all queues, including those that haven't had their page pool created yet. this patch introduces necessary adjustments to prevent potential risks and inconsistency with the error handling behavior. Fixes: 0ebab78 ("net: veth: add page_pool for page recycling") Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> Signed-off-by: Liang Chen <liangchen.linux@gmail.com> Link: https://lore.kernel.org/r/20230812023016.10553-1-liangchen.linux@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f6f978f commit 8a519a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/veth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,9 @@ static int __veth_napi_enable_range(struct net_device *dev, int start, int end)
10811081
err_xdp_ring:
10821082
for (i--; i >= start; i--)
10831083
ptr_ring_cleanup(&priv->rq[i].xdp_ring, veth_ptr_free);
1084+
i = end;
10841085
err_page_pool:
1085-
for (i = start; i < end; i++) {
1086+
for (i--; i >= start; i--) {
10861087
page_pool_destroy(priv->rq[i].page_pool);
10871088
priv->rq[i].page_pool = NULL;
10881089
}

0 commit comments

Comments
 (0)