Commit d0057ca4c1fe73c05a9e077cc7691217370b3283

Authored by David Rientjes
Committed by Linus Torvalds
1 parent e39435ce68

arch/x86/mm/kmemcheck/kmemcheck.c: use kstrtoint() instead of sscanf()

Kmemcheck should use the preferred interface for parsing command line
arguments, kstrto*(), rather than sscanf() itself.  Use it
appropriately.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff

arch/x86/mm/kmemcheck/kmemcheck.c
... ... @@ -78,10 +78,16 @@
78 78 */
79 79 static int __init param_kmemcheck(char *str)
80 80 {
  81 + int val;
  82 + int ret;
  83 +
81 84 if (!str)
82 85 return -EINVAL;
83 86  
84   - sscanf(str, "%d", &kmemcheck_enabled);
  87 + ret = kstrtoint(str, 0, &val);
  88 + if (ret)
  89 + return ret;
  90 + kmemcheck_enabled = val;
85 91 return 0;
86 92 }
87 93