Skip to contentSkip to conversation

net: libwx: fix an error code in wx_alloc_page_pool()

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 9, 2023 – Feb 11, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")

---
Applies to net-next.

 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/wangxun/libwx/wx_lib.c +1 -1
index 57e1871ea0c6..ca92fe19a663 100644
@@ -1745,8 +1745,8 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring)
 
 	rx_ring->page_pool = page_pool_create(&pp_params);
 	if (IS_ERR(rx_ring->page_pool)) {
-		rx_ring->page_pool = NULL;
 		ret = PTR_ERR(rx_ring->page_pool);
+		rx_ring->page_pool = NULL;
 	}
 
 	return ret;
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 9 Feb 2023 16:43:06 +0300 you wrote:

This function always returns success. We need to preserve the error code before setting rx_ring->page_pool = NULL.

Fixes 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")

---
Applies to net-next.

[...]

Here is the summary with links:
- [net-next] net: libwx: fix an error code in wx_alloc_page_pool()

    https://git.kernel.org/netdev/net-next/c/183514f7c569

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html