Skip to content

Commit 33981b1

Browse files
author
Alexandre Ghiti
committed
riscv: Fix missing __free_pages() in check_vector_unaligned_access()
The locally allocated pages are never freed up, so add the corresponding __free_pages(). Fixes: e7c9d66 ("RISC-V: Report vector unaligned access speed hwprobe") Link: https://lore.kernel.org/r/20250228090613.345309-1-alexghiti@rivosinc.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent 475afa3 commit 33981b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/riscv/kernel/unaligned_access_speed.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static void check_vector_unaligned_access(struct work_struct *work __always_unus
349349
pr_warn("cpu%d: rdtime lacks granularity needed to measure unaligned vector access speed\n",
350350
cpu);
351351

352-
return;
352+
goto free;
353353
}
354354

355355
if (word_cycles < byte_cycles)
@@ -363,6 +363,9 @@ static void check_vector_unaligned_access(struct work_struct *work __always_unus
363363
(speed == RISCV_HWPROBE_MISALIGNED_VECTOR_FAST) ? "fast" : "slow");
364364

365365
per_cpu(vector_misaligned_access, cpu) = speed;
366+
367+
free:
368+
__free_pages(page, MISALIGNED_BUFFER_ORDER);
366369
}
367370

368371
static int riscv_online_cpu_vec(unsigned int cpu)

0 commit comments

Comments
 (0)