linux/arch/x86/kernel/cpu/mtrr
Thorsten Blum 9a4af5a00a x86/mtrr: Use kstrtoul() in parse_mtrr_spare_reg()
Replace the deprecated simple_strtoul()¹ with kstrtoul() for parsing the early
boot parameter mtrr_spare_reg_nr. simple_strtoul() silently sets
nr_mtrr_spare_reg to 0 for invalid input instead of rejecting it and keeping
the default value.

Return kstrtoul()'s retval directly to propagate parsing failures instead of
treating them as success. Also return -EINVAL when '=' is missing from the
boot parameter and 'arg' is NULL.

  ¹ https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull

  [ bp: Massage commit message. ]

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260302135341.3473-2-thorsten.blum@linux.dev
2026-03-02 17:25:31 +01:00
..
amd.c x86/mtrr: Replace vendor tests in MTRR code 2023-06-01 15:04:32 +02:00
centaur.c x86/mtrr: Remove unused code 2023-06-01 15:04:33 +02:00
cleanup.c x86/mtrr: Use kstrtoul() in parse_mtrr_spare_reg() 2026-03-02 17:25:31 +01:00
cyrix.c x86/mtrr: Replace vendor tests in MTRR code 2023-06-01 15:04:32 +02:00
generic.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
if.c x86/mtrr: Remove unnecessary strlen() in mtrr_write() 2025-02-25 20:50:55 +01:00
legacy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile x86/mtrr: Move 32-bit code from mtrr.c to legacy.c 2023-06-01 15:04:33 +02:00
mtrr.c x86/mtrr: Remove license boilerplate text with bad FSF address 2025-08-22 19:37:11 +02:00
mtrr.h x86/{boot,mtrr}: Remove unused function declarations 2025-11-22 21:26:36 +01:00