mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
riscv: cpufeature: Fix extension subset checking
This loop is supposed to check if ext->subset_ext_ids[j] is valid, rather
than if ext->subset_ext_ids[i] is valid, before setting the extension
id ext->subset_ext_ids[j] in isainfo->isa.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Fixes: 0d8295ed97
("riscv: add ISA extension parsing for scalar crypto")
Link: https://lore.kernel.org/r/20240502-cpufeature_fixes-v4-2-b3d1a088722d@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
e482eab4d1
commit
e67e98ee89
@ -603,7 +603,7 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap)
|
||||
|
||||
if (ext->subset_ext_size) {
|
||||
for (int j = 0; j < ext->subset_ext_size; j++) {
|
||||
if (riscv_isa_extension_check(ext->subset_ext_ids[i]))
|
||||
if (riscv_isa_extension_check(ext->subset_ext_ids[j]))
|
||||
set_bit(ext->subset_ext_ids[j], isainfo->isa);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user