Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aQYKkrGA12REb2sj@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dan Carpenter and committed by
Jakub Kicinski
2e25935e de0337d6

+2 -4
+2 -4
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
··· 1516 1516 pool->xdp_cnt = numptrs; 1517 1517 pool->xdp = devm_kcalloc(pfvf->dev, 1518 1518 numptrs, sizeof(struct xdp_buff *), GFP_KERNEL); 1519 - if (IS_ERR(pool->xdp)) { 1520 - netdev_err(pfvf->netdev, "Creation of xsk pool failed\n"); 1521 - return PTR_ERR(pool->xdp); 1522 - } 1519 + if (!pool->xdp) 1520 + return -ENOMEM; 1523 1521 } 1524 1522 1525 1523 return 0;