Skip to content

Commit 9de29ea

Browse files
Dan CarpenterIngo Molnar
authored andcommitted
x86/spectre: Fix an error message
If i == ARRAY_SIZE(mitigation_options) then we accidentally print garbage from one space beyond the end of the mitigation_options[] array. Signed-off-by: Dan Carpenter <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: KarimAllah Ahmed <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: 9005c68 ("x86/spectre: Simplify spectre_v2 command line parsing") Link: http://lkml.kernel.org/r/20180214071416.GA26677@mwanda Signed-off-by: Ingo Molnar <[email protected]>
1 parent b399151 commit 9de29ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
174174
}
175175

176176
if (i >= ARRAY_SIZE(mitigation_options)) {
177-
pr_err("unknown option (%s). Switching to AUTO select\n", mitigation_options[i].option);
177+
pr_err("unknown option (%s). Switching to AUTO select\n", arg);
178178
return SPECTRE_V2_CMD_AUTO;
179179
}
180180
}

0 commit comments

Comments
 (0)