Skip to content

Commit 2e25935

Browse files
Dan Carpenterkuba-moo
authored andcommitted
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: efabce2 ("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>
1 parent de0337d commit 2e25935

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,8 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
15161516
pool->xdp_cnt = numptrs;
15171517
pool->xdp = devm_kcalloc(pfvf->dev,
15181518
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;
15231521
}
15241522

15251523
return 0;

0 commit comments

Comments
 (0)