mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
powerpc/rtas: Replaced simple_strtoull() with kstrtoull()
The simple_strtoull() function is deprecated in some situation, since it does not check for the range overflow, use kstrtoull() instead. Signed-off-by: Chen Huang <chenhuang5@huawei.com> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210526092020.554341-1-chenhuang5@huawei.com
This commit is contained in:
parent
59510820ff
commit
08d61b46c5
1 changed files with 1 additions and 6 deletions
|
@ -259,7 +259,6 @@ __initcall(proc_rtas_init);
|
||||||
static int parse_number(const char __user *p, size_t count, u64 *val)
|
static int parse_number(const char __user *p, size_t count, u64 *val)
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
char *end;
|
|
||||||
|
|
||||||
if (count > 39)
|
if (count > 39)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -269,11 +268,7 @@ static int parse_number(const char __user *p, size_t count, u64 *val)
|
||||||
|
|
||||||
buf[count] = 0;
|
buf[count] = 0;
|
||||||
|
|
||||||
*val = simple_strtoull(buf, &end, 10);
|
return kstrtoull(buf, 10, val);
|
||||||
if (*end && *end != '\n')
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************************************************************** */
|
/* ****************************************************************** */
|
||||||
|
|
Loading…
Reference in a new issue