[PATCH 3/4] nvme-pci: release descriptor pools on probe failure
Nilay Shroff
nilay at linux.ibm.com
Thu Jul 30 05:07:40 PDT 2026
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 <kanie at linux.alibaba.com>
Looks good to me.
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list