Skip to content

Commit 3f4818e

Browse files
nicolincjgunthorpe
authored andcommitted
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: [email protected] Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Nicolin Chen <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 442003f commit 3f4818e

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
@@ -213,6 +213,7 @@ void iommufd_fault_destroy(struct iommufd_object *obj)
213213
{
214214
struct iommufd_fault *fault = container_of(obj, struct iommufd_fault, obj);
215215
struct iopf_group *group, *next;
216+
unsigned long index;
216217

217218
/*
218219
* The iommufd object's reference count is zero at this point.
@@ -225,6 +226,13 @@ void iommufd_fault_destroy(struct iommufd_object *obj)
225226
iopf_group_response(group, IOMMU_PAGE_RESP_INVALID);
226227
iopf_free_group(group);
227228
}
229+
xa_for_each(&fault->response, index, group) {
230+
xa_erase(&fault->response, index);
231+
iopf_group_response(group, IOMMU_PAGE_RESP_INVALID);
232+
iopf_free_group(group);
233+
}
234+
xa_destroy(&fault->response);
235+
mutex_destroy(&fault->mutex);
228236
}
229237

230238
static void iommufd_compose_fault_message(struct iommu_fault *fault,

0 commit comments

Comments
 (0)