Skip to contentSkip to conversation

hinic3: Fix NULL vs IS_ERR() check in hinic3_alloc_rxqs_res()

PATCH Applied Dan Carpenter 3 participants 3 messages Sep 18, 2025 – Sep 19, 2025

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

PATCH 1/1 hinic3: Fix NULL vs IS_ERR() check in hinic3_alloc_rxqs_res()

The page_pool_create() function never returns NULL, it returns error pointers. Update the check to match.

Fixes 73f37a7e1993 ("hinic3: Queue pair resource initialization")
---
 drivers/net/ethernet/huawei/hinic3/hinic3_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c +1 -1
index 6cfe3bdd8ee5..16c00c3bb1ed 100644
@@ -414,7 +414,7 @@ int hinic3_alloc_rxqs_res(struct net_device *netdev, u16 num_rq,
 		pp_params.dma_dir = DMA_FROM_DEVICE;
 		pp_params.max_len = PAGE_SIZE;
 		rqres->page_pool = page_pool_create(&pp_params);
-		if (!rqres->page_pool) {
+		if (IS_ERR(rqres->page_pool)) {
 			netdev_err(netdev, "Failed to create rxq%d page pool\n",
 				   idx);
 			goto err_free_cqe;
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Dan Carpenter

The page_pool_create() function never returns NULL, it returns error pointers. Update the check to match.

Fixes 73f37a7e1993 ("hinic3: Queue pair resource initialization")
---
  drivers/net/ethernet/huawei/hinic3/hinic3_rx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c +0 -0
index 6cfe3bdd8ee5..16c00c3bb1ed 100644

drivers/net/ethernet/huawei/hinic3/hinic3_rx.c int hinic3_alloc_rxqs_res(struct net_device *netdev, u16 num_rq, · line 420

Quoted 8 lines
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c +1 -1
@@ -414,7 +414,7 @@ int hinic3_alloc_rxqs_res(struct net_device *netdev, u16 num_rq,
  		pp_params.dma_dir = DMA_FROM_DEVICE;
  		pp_params.max_len = PAGE_SIZE;
  		rqres->page_pool = page_pool_create(&pp_params);
-		if (!rqres->page_pool) {
+		if (IS_ERR(rqres->page_pool)) {
  			netdev_err(netdev, "Failed to create rxq%d page pool\n",
  				   idx);
  			goto err_free_cqe;
#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 8 lines · On Thu, 18 Sep 2025 12:45:47 +0300 you wrote:

The page_pool_create() function never returns NULL, it returns error pointers. Update the check to match.

Fixes 73f37a7e1993 ("hinic3: Queue pair resource initialization")
---
 drivers/net/ethernet/huawei/hinic3/hinic3_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net-next] hinic3: Fix NULL vs IS_ERR() check in hinic3_alloc_rxqs_res()

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

You are awesome, thank you!

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