]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: wwan: t7xx: destroy DMA pool on CLDMA late init failure
authorHaoxiang Li <haoxiang_li2024@163.com>
Sun, 21 Jun 2026 03:17:14 +0000 (11:17 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Jun 2026 01:44:41 +0000 (18:44 -0700)
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.

Fixes: 39d439047f1d ("net: wwan: t7xx: Add control DMA interface")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20260621031714.3605022-1-haoxiang_li2024@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wwan/t7xx/t7xx_hif_cldma.c

index e10cb4f9104e33c009dd4b414a12c2cc398f5bc2..2917cee9b802857c71ba18024a8ffea9d20b148c 100644 (file)
@@ -1063,6 +1063,9 @@ err_free_tx_ring:
        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;
 }