rust: allocator: Use krealloc_aligned() in KernelAllocator::alloc
authorBoqun Feng <boqun.feng@gmail.com>
Sun, 30 Jul 2023 01:29:03 +0000 (18:29 -0700)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 7 Aug 2023 09:33:33 +0000 (11:33 +0200)
commitf39a97d0d8a765268b8de17f2e34393e7cb2cd2d
tree55c5d2e12293e2bb2f1ab45a13a5bd0762c2ddbb
parent917b2e00b90f7a0f21ab3f28e7cf165825a7aba7
rust: allocator: Use krealloc_aligned() in KernelAllocator::alloc

This fixes the potential issue that when KernelAllocator is used, the
allocation may be mis-aligned due to SLAB's alignment guarantee.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20230730012905.643822-3-boqun.feng@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/allocator.rs