iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace()
authorNicolin Chen <nicolinc@nvidia.com>
Thu, 18 Jul 2024 05:01:30 +0000 (22:01 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 29 Jul 2024 18:14:32 +0000 (15:14 -0300)
commit950aeefb34923fe3c28ade35fe05f24e2c5b1d55
tree407c19b4864f5d07292b1b7e2d124da79cbebede
parent8400291e289ee6b2bf9779ff1c83a291501f017b
iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace()

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
Link: https://patch.msgid.link/r/20240718050130.1956804-1-nicolinc@nvidia.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/device.c