Skip to content

Commit 083c016

Browse files
committed
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 <bchen@crusoe.ai>
1 parent 203e79e commit 083c016

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iommufd-ioctls/src/iommufd_ioctls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub(crate) mod iommufd_syscall {
100100
// 2. The 'unmap' points to initialized memory with expected data structure,
101101
// and remains valid for the duration of syscall.
102102
// 3. The return value is checked.
103-
let ret = unsafe { ioctl_with_ref(iommufd, IOMMU_IOAS_UNMAP(), unmap) };
103+
let ret = unsafe { ioctl_with_mut_ref(iommufd, IOMMU_IOAS_UNMAP(), unmap) };
104104
if ret < 0 {
105105
Err(IommufdError::IommuIoasUnmap(SysError::last()))
106106
} else {

0 commit comments

Comments
 (0)