Skip to content

Commit e67e98e

Browse files
charlie-rivospalmer-dabbelt
authored andcommitted
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 <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Fixes: 0d8295e ("riscv: add ISA extension parsing for scalar crypto") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent e482eab commit e67e98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap)
603603

604604
if (ext->subset_ext_size) {
605605
for (int j = 0; j < ext->subset_ext_size; j++) {
606-
if (riscv_isa_extension_check(ext->subset_ext_ids[i]))
606+
if (riscv_isa_extension_check(ext->subset_ext_ids[j]))
607607
set_bit(ext->subset_ext_ids[j], isainfo->isa);
608608
}
609609
}

0 commit comments

Comments
 (0)