From 7b5efa189aafb100b7edc8b32d3389be80973862 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Mon, 29 Dec 2025 19:53:19 +0000 Subject: [PATCH] iommufd_ioctls: Use *mut cast for IOMMU_IOAS_UNMAP The kernel updates the length field to return the unmapped size, so the struct should be passed as a mutable pointer to the ioctl. Signed-off-by: Bo Chen --- iommufd-ioctls/src/iommufd_ioctls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iommufd-ioctls/src/iommufd_ioctls.rs b/iommufd-ioctls/src/iommufd_ioctls.rs index c7c35ab..921c9c8 100644 --- a/iommufd-ioctls/src/iommufd_ioctls.rs +++ b/iommufd-ioctls/src/iommufd_ioctls.rs @@ -100,7 +100,7 @@ pub(crate) mod iommufd_syscall { // 2. The 'unmap' points to initialized memory with expected data structure, // and remains valid for the duration of syscall. // 3. The return value is checked. - let ret = unsafe { ioctl_with_ref(iommufd, IOMMU_IOAS_UNMAP(), unmap) }; + let ret = unsafe { ioctl_with_mut_ref(iommufd, IOMMU_IOAS_UNMAP(), unmap) }; if ret < 0 { Err(IommufdError::IommuIoasUnmap(SysError::last())) } else {