From 4b17dfb3e22fdccf74839d2fc52362ddc257024e Mon Sep 17 00:00:00 2001 From: Yilin Chen <1479826151@qq.com> Date: Tue, 7 Jul 2026 16:10:30 +0000 Subject: [PATCH] rust: miscdevice: fix write_iter safety docs The write_iter callback consumes data from the supplied iov_iter and wraps it as an IovIterSource. Its Safety docs required a valid iov_iter for writing, but the implementation and the IovIterSource contract require one that is valid for reading. Update the docs to match that direction. Assisted-by: Codex:GPT-5 Signed-off-by: Yilin Chen <1479826151@qq.com> Link: https://patch.msgid.link/tencent_8CD671E0F35223030143524D045F3BCAD506@qq.com Signed-off-by: Greg Kroah-Hartman --- rust/kernel/miscdevice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs index 83ce50def5ac..3abef1b8543d 100644 --- a/rust/kernel/miscdevice.rs +++ b/rust/kernel/miscdevice.rs @@ -289,7 +289,7 @@ impl MiscdeviceVTable { /// # Safety /// /// `kiocb` must be correspond to a valid file that is associated with a - /// `MiscDeviceRegistration`. `iter` must be a valid `struct iov_iter` for writing. + /// `MiscDeviceRegistration`. `iter` must be a valid `struct iov_iter` for reading. unsafe extern "C" fn write_iter( kiocb: *mut bindings::kiocb, iter: *mut bindings::iov_iter,