All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace()
@ 2024-07-18  5:01 Nicolin Chen
  2024-07-18  5:13 ` Tian, Kevin
  2024-07-29 18:16 ` Jason Gunthorpe
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolin Chen @ 2024-07-18  5:01 UTC (permalink / raw)
  To: jgg, kevin.tian; +Cc: yi.l.liu, iommu, linux-kernel

The rewind routine should remove the reserved iovas added to the new hwpt.

Fixes: 89db31635c87 ("iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable")
Cc: stable@vger.kernel.org
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
---
 drivers/iommu/iommufd/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index 9a7ec5997c61c..3214a4c17c6b3 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -526,7 +526,7 @@ iommufd_device_do_replace(struct iommufd_device *idev,
 err_unresv:
 	if (hwpt_is_paging(hwpt))
 		iommufd_group_remove_reserved_iova(igroup,
-						   to_hwpt_paging(old_hwpt));
+						   to_hwpt_paging(hwpt));
 err_unlock:
 	mutex_unlock(&idev->igroup->lock);
 	return ERR_PTR(rc);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-29 18:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18  5:01 [PATCH] iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace() Nicolin Chen
2024-07-18  5:13 ` Tian, Kevin
2024-07-28 23:36   ` Nicolin Chen
2024-07-29 12:35     ` Jason Gunthorpe
2024-07-29 18:16 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.