From: Nicolin Chen <nicolinc@xxxxxxxxxx> commit 3f4818ec139030f425476bf8a10b616bab53a7b5 upstream. Both were missing in the initial patch. Fixes: 07838f7fd529 ("iommufd: Add iommufd fault object") Link: https://patch.msgid.link/r/bc8bb13e215af27e62ee51bdba3648dd4ed2dce3.1736923732.git.nicolinc@xxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/iommu/iommufd/fault.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -208,6 +208,7 @@ void iommufd_fault_destroy(struct iommuf { struct iommufd_fault *fault = container_of(obj, struct iommufd_fault, obj); struct iopf_group *group, *next; + unsigned long index; /* * The iommufd object's reference count is zero at this point. @@ -220,6 +221,13 @@ void iommufd_fault_destroy(struct iommuf iopf_group_response(group, IOMMU_PAGE_RESP_INVALID); iopf_free_group(group); } + xa_for_each(&fault->response, index, group) { + xa_erase(&fault->response, index); + iopf_group_response(group, IOMMU_PAGE_RESP_INVALID); + iopf_free_group(group); + } + xa_destroy(&fault->response); + mutex_destroy(&fault->mutex); } static void iommufd_compose_fault_message(struct iommu_fault *fault, Patches currently in stable-queue which might be from nicolinc@xxxxxxxxxx are queue-6.12/iommufd-fix-struct-iommu_hwpt_pgfault-init-and-padding.patch queue-6.12/iommufd-fault-use-a-separate-spinlock-to-protect-fault-deliver-list.patch queue-6.12/iommufd-fault-destroy-response-and-mutex-in-iommufd_fault_destroy.patch queue-6.12/iommu-tegra241-cmdqv-read-smmu-idr1.cmdqs-instead-of-hardcoding.patch