net: wwan: t7xx: destroy DMA pool on CLDMA late init failure
Subsystems (5)
PATCH 1/1 net: wwan: t7xx: destroy DMA pool on CLDMA late init failure
t7xx_cldma_late_init() creates md_ctrl->gpd_dmapool before initializing the TX and RX rings. If any ring initialization fails, the error path frees the already initialized rings but leaves the DMA pool allocated.
Destroy md_ctrl->gpd_dmapool on the late-init failure path to avoid leaking the DMA pool.
--- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wwan/t7xx/t7xx_hif_cldma.c +3 -0
@@ -1063,6 +1063,9 @@ static int t7xx_cldma_late_init(struct cldma_ctrl *md_ctrl)while (i--)t7xx_cldma_ring_free (md_ctrl, &md_ctrl->tx_ring[i],DMA_TO_DEVICE ); +dma_pool_destroy (md_ctrl->gpd_dmapool); + md_ctrl->gpd_dmapool =NULL ; +return ret; }
Signature · 1 line
2.25.1
Quoted 6 lines · Haoxiang Li
t7xx_cldma_late_init()createsmd_ctrl->gpd_dmapoolbefore initializing the TX and RX rings. If any ring initialization fails, the error path frees the already initialized rings but leaves the DMA pool allocated.
Quoted 6 lines
Destroy
md_ctrl->gpd_dmapoolon the late-init failure path to avoid leaking the DMA pool.Fixes 39d439047f1d ("net: wwan: t7xx: Add control DMA interface")Signed-off-by Haoxiang Li <[email protected]>
Quoted 21 lines
--- drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/wwan/t7xx/t7xx_hif_cldma.c +3
-1@@ -1063,6 +1063,9 @@ static int t7xx_cldma_late_init(struct cldma_ctrl *md_ctrl)while (i--)t7xx_cldma_ring_free (md_ctrl, &md_ctrl->tx_ring[i],DMA_TO_DEVICE ); +dma_pool_destroy (md_ctrl->gpd_dmapool); + md_ctrl->gpd_dmapool =NULL ; +return ret; } --2.25.1
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 Sun, 21 Jun 2026 11:17:14 +0800 you wrote:
t7xx_cldma_late_init()createsmd_ctrl->gpd_dmapoolbefore initializing the TX and RX rings. If any ring initialization fails, the error path frees the already initialized rings but leaves the DMA pool allocated.Destroy
md_ctrl->gpd_dmapoolon the late-init failure path to avoid leaking the DMA pool.[...]
Here is the summary with links:
- net: wwan: t7xx: destroy DMA pool on CLDMA late init failure
https://git.kernel.org/netdev/net/c/2bd6f26d4ce1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html