mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 19:21:28 +02:00
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: efabce2901 ("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>
This commit is contained in:
parent
de0337d641
commit
2e25935ed2
|
|
@ -1516,10 +1516,8 @@ int otx2_pool_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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user