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 1b580e7b9b ("rust:
uaccess: add userspace pointers").

Fixes: 1b580e7b9b ("rust: uaccess: add userspace pointers")
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Charalampos Mitrodimas <charmitro@posteo.net>
Link: https://lore.kernel.org/r/20250317-uaccess-typo-reserve-v1-1-bbfcb45121f3@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Tamir Duberstein 2025-03-17 07:43:03 -04:00 committed by Miguel Ojeda
parent f6be7af445
commit 4e72a62e8d

View File

@ -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