octeontx2-pf: Fix devm_kcalloc() error checking
Subsystems (5)
PATCH 1/1 octeontx2-pf: Fix devm_kcalloc() error checking
The devm_kcalloc() function never return error pointers, it returns NULL on failure. Also delete the netdev_err() printk. These allocation functions already have debug output built-in some the extra error message is not required.
Fixes efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +2 -4
@@ -1530,10 +1530,8 @@ int otx2_pool_aq_init(struct otx2_nic *pfvf, u16 pool_id, pool->xdp_cnt = numptrs; pool->xdp =devm_kcalloc (pfvf->dev, numptrs,sizeof (struct xdp_buff *),GFP_KERNEL ); -if (IS_ERR (pool->xdp)) { -netdev_err (pfvf->netdev,"Creation of xsk pool failed\n" ); -return PTR_ERR (pool->xdp); - } +if (!pool->xdp) +return -ENOMEM ; }return 0 ;
Signature · 1 line
2.51.0
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Sat, 1 Nov 2025 16:26:42 +0300 you wrote:
The
devm_kcalloc()function never return error pointers, it returns NULL on failure. Also delete thenetdev_err()printk. These allocation functions already have debug output built-in some the extra error message is not required.Fixes efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support")Signed-off-by Dan Carpenter <[email protected]>[...]
Here is the summary with links:
- [net] octeontx2-pf: Fix devm_kcalloc() error checking
https://git.kernel.org/netdev/net/c/2e25935ed24d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html