Skip to content

Commit 183514f

Browse files
error27kuba-moo
authored andcommitted
net: libwx: fix an error code in wx_alloc_page_pool()
This function always returns success. We need to preserve the error code before setting rx_ring->page_pool = NULL. Fixes: 850b971 ("net: libwx: Allocate Rx and Tx resources") Signed-off-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/Y+T4aoefc1XWvGYb@kili Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f99f22e commit 183514f

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/wangxun/libwx

1 file changed

+1
-1
lines changed

drivers/net/ethernet/wangxun/libwx/wx_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,8 +1745,8 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring)
17451745

17461746
rx_ring->page_pool = page_pool_create(&pp_params);
17471747
if (IS_ERR(rx_ring->page_pool)) {
1748-
rx_ring->page_pool = NULL;
17491748
ret = PTR_ERR(rx_ring->page_pool);
1749+
rx_ring->page_pool = NULL;
17501750
}
17511751

17521752
return ret;

0 commit comments

Comments
 (0)