Skip to content

Commit b09313d

Browse files
Andrew Jonespalmer-dabbelt
authored andcommitted
RISC-V: hwprobe: Explicity check for -1 in vdso init
id_bitsmash is unsigned. We need to explicitly check for -1, rather than use > 0. Fixes: aa5af0a ("RISC-V: Add hwprobe vDSO function and data") Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Evan Green <evan@rivosinc.com> Link: https://lore.kernel.org/r/20230426141333.10063-3-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 08dc107 commit b09313d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/kernel/sys_riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int __init init_hwprobe_vdso_data(void)
282282
* populated) or any value returns -1 (varies across CPUs), then the
283283
* vDSO should defer to the kernel for exotic cpu masks.
284284
*/
285-
avd->homogeneous_cpus = (id_bitsmash > 0);
285+
avd->homogeneous_cpus = id_bitsmash != 0 && id_bitsmash != -1;
286286
return 0;
287287
}
288288

0 commit comments

Comments
 (0)