Skip to content

Commit

Permalink
iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace()
Browse files Browse the repository at this point in the history
The rewind routine should remove the reserved iovas added to the new hwpt.

Fixes: 89db316 ("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>
  • Loading branch information
Nicolin Chen authored and Jason Gunthorpe committed Jul 29, 2024
1 parent 8400291 commit 950aeef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/iommufd/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 950aeef

Please sign in to comment.