Skip to content

Commit ab337d7

Browse files
committed
iommufd/fault: Destroy response and mutex in iommufd_fault_destroy()
JIRA: https://issues.redhat.com/browse/RHEL-75942 commit 3f4818e Author: Nicolin Chen <nicolinc@nvidia.com> Date: Tue Jan 14 22:55:59 2025 -0800 iommufd/fault: Destroy response and mutex in iommufd_fault_destroy() Both were missing in the initial patch. Fixes: 07838f7 ("iommufd: Add iommufd fault object") Link: https://patch.msgid.link/r/bc8bb13e215af27e62ee51bdba3648dd4ed2dce3.1736923732.git.nicolinc@nvidia.com Cc: stable@vger.kernel.org Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Eder Zulian <ezulian@redhat.com>
1 parent c277006 commit ab337d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/iommu/iommufd/fault.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ void iommufd_fault_destroy(struct iommufd_object *obj)
208208
{
209209
struct iommufd_fault *fault = container_of(obj, struct iommufd_fault, obj);
210210
struct iopf_group *group, *next;
211+
unsigned long index;
211212

212213
/*
213214
* The iommufd object's reference count is zero at this point.
@@ -220,6 +221,13 @@ void iommufd_fault_destroy(struct iommufd_object *obj)
220221
iopf_group_response(group, IOMMU_PAGE_RESP_INVALID);
221222
iopf_free_group(group);
222223
}
224+
xa_for_each(&fault->response, index, group) {
225+
xa_erase(&fault->response, index);
226+
iopf_group_response(group, IOMMU_PAGE_RESP_INVALID);
227+
iopf_free_group(group);
228+
}
229+
xa_destroy(&fault->response);
230+
mutex_destroy(&fault->mutex);
223231
}
224232

225233
static void iommufd_compose_fault_message(struct iommu_fault *fault,

0 commit comments

Comments
 (0)