Re: [PATCH v2] iommu/vt-d: Clean up si_domain in the init_dmars() error path

From: Baolu Lu
Date: Tue Oct 18 2022 - 21:00:46 EST


On 10/10/22 10:48 PM, Jerry Snitselaar wrote:
A splat from kmem_cache_destroy() was seen with a kernel prior to
commit ee2653bbe89d ("iommu/vt-d: Remove domain and devinfo mempool")
when there was a failure in init_dmars(), because the iommu_domain
cache still had objects. While the mempool code is now gone, there
still is a leak of the si_domain memory if init_dmars() fails. So
clean up si_domain in the init_dmars() error path.

Cc: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
Cc: Joerg Roedel<joro@xxxxxxxxxx>
Cc: Will Deacon<will@xxxxxxxxxx>
Cc: Robin Murphy<robin.murphy@xxxxxxx>
Fixes: 86080ccc223a ("iommu/vt-d: Allocate si_domain in init_dmars()")
Signed-off-by: Jerry Snitselaar<jsnitsel@xxxxxxxxxx>

Thanks for the patch. It has been queued for v6.1.

https://lore.kernel.org/linux-iommu/20221019004447.4563-1-baolu.lu@xxxxxxxxxxxxxxx/

Best regards,
baolu