提交 183514f7 编写于 作者: D Dan Carpenter 提交者: Jakub Kicinski

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: 850b9711 ("net: libwx: Allocate Rx and Tx resources")
Signed-off-by: NDan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y+T4aoefc1XWvGYb@kiliSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 f99f22e0
...@@ -1745,8 +1745,8 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring) ...@@ -1745,8 +1745,8 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring)
rx_ring->page_pool = page_pool_create(&pp_params); rx_ring->page_pool = page_pool_create(&pp_params);
if (IS_ERR(rx_ring->page_pool)) { if (IS_ERR(rx_ring->page_pool)) {
rx_ring->page_pool = NULL;
ret = PTR_ERR(rx_ring->page_pool); ret = PTR_ERR(rx_ring->page_pool);
rx_ring->page_pool = NULL;
} }
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册