Skip to content

Commit 8217ad0

Browse files
ardbiesheuvelbp3tk0v
authored andcommitted
decompress: Use 8 byte alignment
The ZSTD decompressor requires malloc() allocations to be 8 byte aligned, so ensure that this the case. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230807162720.545787-19-ardb@kernel.org
1 parent 1107887 commit 8217ad0

File tree

1 file changed

+1
-1
lines changed
  • include/linux/decompress

1 file changed

+1
-1
lines changed

include/linux/decompress/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ MALLOC_VISIBLE void *malloc(int size)
4848
if (!malloc_ptr)
4949
malloc_ptr = free_mem_ptr;
5050

51-
malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */
51+
malloc_ptr = (malloc_ptr + 7) & ~7; /* Align */
5252

5353
p = (void *)malloc_ptr;
5454
malloc_ptr += size;

0 commit comments

Comments
 (0)