Commit 4e72a62e authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Miguel Ojeda
Browse files

rust: uaccess: name the correct function



Correctly refer to `reserve` rather than `try_reserve` in a comment.  This
comment has been incorrect since inception in commit 1b580e7b ("rust:
uaccess: add userspace pointers").

Fixes: 1b580e7b ("rust: uaccess: add userspace pointers")
Signed-off-by: default avatarTamir Duberstein <tamird@gmail.com>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
Reviewed-by: default avatarCharalampos Mitrodimas <charmitro@posteo.net>
Link: https://lore.kernel.org/r/20250317-uaccess-typo-reserve-v1-1-bbfcb45121f3@gmail.com


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent f6be7af4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -285,8 +285,7 @@ pub fn read_all<A: Allocator>(mut self, buf: &mut Vec<u8, A>, flags: Flags) -> R
        let len = self.length;
        buf.reserve(len, flags)?;

        // The call to `try_reserve` was successful, so the spare capacity is at least `len` bytes
        // long.
        // The call to `reserve` was successful, so the spare capacity is at least `len` bytes long.
        self.read_raw(&mut buf.spare_capacity_mut()[..len])?;

        // SAFETY: Since the call to `read_raw` was successful, so the next `len` bytes of the