diff options
| author | Brendan Shephard <bshephar@bne-home.net> | 2025-12-23 15:56:47 +1000 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2025-12-29 15:32:53 +0100 |
| commit | f91ffed95c06e94c835cd7deaea666d69948cde9 (patch) | |
| tree | 071dbb153cf2f4baaf5e724afb4b1e780bf59c70 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 51293e589bafb4281a597986b3416471f67a79c2 (diff) | |
rust: Return Option from page_align and ensure no usize overflow
Change `page_align()` to return `Option<usize>` to allow validation
of the provided `addr` value. This ensures that any value that is
within one `PAGE_SIZE` of `usize::MAX` will not panic, and instead
returns `None` to indicate overflow.
Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251223055647.9761-1-bshephar@bne-home.net
[ Use kernel vertical style for imports; use markdown in comments.
- Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
