Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5e: Fix error handling in RQ memory model registration

Currently when xdp_rxq_info_reg_mem_model() fails in the XSK path, the
error handling incorrectly jumps to err_destroy_page_pool. While this
may not cause errors, we should make it jump to the correct location.

Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Acked-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Fushuai Wang and committed by
David S. Miller
7012d4f3 20a0c20f

+6 -3
+6 -3
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 952 952 if (xsk) { 953 953 err = xdp_rxq_info_reg_mem_model(&rq->xdp_rxq, 954 954 MEM_TYPE_XSK_BUFF_POOL, NULL); 955 + if (err) 956 + goto err_free_by_rq_type; 955 957 xsk_pool_set_rxq_info(rq->xsk_pool, &rq->xdp_rxq); 956 958 } else { 957 959 /* Create a page_pool and register it with rxq */ ··· 987 985 } 988 986 if (!rq->hd_page_pool) 989 987 rq->hd_page_pool = rq->page_pool; 990 - if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) 988 + if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) { 991 989 err = xdp_rxq_info_reg_mem_model(&rq->xdp_rxq, 992 990 MEM_TYPE_PAGE_POOL, rq->page_pool); 991 + if (err) 992 + goto err_destroy_page_pool; 993 + } 993 994 } 994 - if (err) 995 - goto err_destroy_page_pool; 996 995 997 996 for (i = 0; i < wq_sz; i++) { 998 997 if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {