Re: [PATCH 3/4] nvme-pci: release descriptor pools on probe failure

Nilay Shroff <[email protected]> Thu, 30 Jul 2026 17:37:40 +0530
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On 7/30/26 10:01 AM, Guixin Liu wrote:
> The per-NUMA-node descriptor DMA pools are created lazily from
> nvme_init_hctx_common() once the admin tag set is allocated, but they are
> only destroyed in nvme_remove() via nvme_release_descriptor_pools(). Any
> probe failure after the admin tag set has been allocated unwinds through
> the out_disable label and nvme_pci_free_ctrl(), neither of which releases
> the pools, leaking the dma_pool objects.
> 
> Release the descriptor pools in the out_disable error path. It must not
> be added to nvme_pci_free_ctrl(), as that would double-free against
> nvme_remove() on the normal teardown path.
> 
> Fixes: d977506f8863 ("nvme-pci: make PRP list DMA pools per-NUMA-node")
> Signed-off-by: Guixin Liu <[email protected]>

Looks good to me.

Reviewed-by: Nilay Shroff <[email protected]>