From 615cba3557f1bad6061acde2067a3edbf80d90c2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 23 Feb 2019 20:42:19 +0100 Subject: staging: speakup: Note that simple_strtoul can't simply be replaced by kstrtoul We often receive patches which erroneously try to use kstrtoul in these places. Signed-off-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/kobjects.c | 2 ++ drivers/staging/speakup/main.c | 1 + drivers/staging/speakup/varhandlers.c | 1 + 3 files changed, 4 insertions(+) (limited to 'drivers/staging') diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 2e36d872662c..11c704b27c3c 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -154,6 +154,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj, continue; } + /* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, &temp, 10); if (index > 255) { rejected++; @@ -787,6 +788,7 @@ static ssize_t message_store_helper(const char *buf, size_t count, continue; } + /* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, &temp, 10); while ((temp < linefeed) && (*temp == ' ' || *temp == '\t')) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index 869f40ebf1a7..c092a8ea45e2 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1979,6 +1979,7 @@ oops: return 1; } + /* Do not replace with kstrtoul: here we need cp to be updated */ goto_pos = simple_strtoul(goto_buf, &cp, 10); if (*cp == 'x') { diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 1b545152cc49..3c944cb8f547 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -328,6 +328,7 @@ char *spk_s2uchar(char *start, char *dest) { int val; + /* Do not replace with kstrtoul: here we need start to be updated */ val = simple_strtoul(skip_spaces(start), &start, 10); if (*start == ',') start++; -- cgit