Commit 8d76c02f9a

Nameless <truemedian@gmail.com>
2024-09-20 01:03:33
uefi: erroneous alignment check in pool_allocator
Fixes #21446 Both UefiPoolAllocator and UefiRawPoolAllocator were passing the value of `log2_ptr_align` directly to `mem.alignAllocLen` which expects a alignment value. Both of these calls to `mem.alignAllocLen` are pointless and the result of the alignment both always true, and was thrown away anyway. I have removed these calls entirely.
1 parent 37cd21e
Changed files (1)
lib
std
lib/std/os/uefi/pool_allocator.zig
@@ -48,11 +48,9 @@ const UefiPoolAllocator = struct {
         ret_addr: usize,
     ) bool {
         _ = ret_addr;
+        _ = log2_old_ptr_align;
 
         if (new_len > buf.len) return false;
-
-        _ = mem.alignAllocLen(buf.len, new_len, log2_old_ptr_align);
-
         return true;
     }
 
@@ -121,9 +119,6 @@ fn uefi_resize(
     std.debug.assert(log2_old_ptr_align <= 3);
 
     if (new_len > buf.len) return false;
-
-    _ = mem.alignAllocLen(buf.len, new_len, 8);
-
     return true;
 }