Skip to content

Commit b4ff830

Browse files
committed
iommufd: Do not add the same hwpt to the ioas->hwpt_list twice
The hwpt is added to the hwpt_list only during its creation, it is never added again. This hunk is some missed leftover from rework. Adding it twice will corrupt the linked list in some cases. It effects HWPT specific attachment, which is something the test suite cannot cover until we can create a legitimate struct device with a non-system iommu "driver" (ie we need the bus removed from the iommu code) Cc: [email protected] Fixes: e8d5721 ("iommufd: Add kAPI toward external drivers for physical devices") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Kevin Tian <[email protected]> Reported-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent b3551ea commit b4ff830

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/iommu/iommufd/device.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,6 @@ int iommufd_device_attach(struct iommufd_device *idev, u32 *pt_id)
344344
rc = iommufd_device_do_attach(idev, hwpt);
345345
if (rc)
346346
goto out_put_pt_obj;
347-
348-
mutex_lock(&hwpt->ioas->mutex);
349-
list_add_tail(&hwpt->hwpt_item, &hwpt->ioas->hwpt_list);
350-
mutex_unlock(&hwpt->ioas->mutex);
351347
break;
352348
}
353349
case IOMMUFD_OBJ_IOAS: {

0 commit comments

Comments
 (0)