mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
net: stmmac: fix possible memory leak in stmmac_dvr_probe()
[ Upstream commita137f3f27f] The bitmap_free() should be called to free priv->af_xdp_zc_qps when create_singlethread_workqueue() fails, otherwise there will be a memory leak, so we add the err path error_wq_init to fix it. Fixes:bba2556efa("net: stmmac: Enable RX via AF_XDP zero-copy") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
bfbc4f7f82
commit
446757787b
|
|
@ -7097,7 +7097,7 @@ int stmmac_dvr_probe(struct device *device,
|
|||
priv->wq = create_singlethread_workqueue("stmmac_wq");
|
||||
if (!priv->wq) {
|
||||
dev_err(priv->device, "failed to create workqueue\n");
|
||||
return -ENOMEM;
|
||||
goto error_wq_init;
|
||||
}
|
||||
|
||||
INIT_WORK(&priv->service_task, stmmac_service_task);
|
||||
|
|
@ -7325,6 +7325,7 @@ int stmmac_dvr_probe(struct device *device,
|
|||
stmmac_napi_del(ndev);
|
||||
error_hw_init:
|
||||
destroy_workqueue(priv->wq);
|
||||
error_wq_init:
|
||||
bitmap_free(priv->af_xdp_zc_qps);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user