All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 1/3] powerpc/rtas: Replaced simple_strtoull() with kstrtoull()
@ 2021-05-26  9:20 ` Chen Huang
  0 siblings, 0 replies; 15+ messages in thread
From: Chen Huang @ 2021-05-26  9:20 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Mark Fasheh,
	Joel Becker, Joseph Qi, Nathan Lynch, Andrew Donnellan,
	Alexey Kardashevskiy, Andrew Morton, Stephen Rothwell,
	Jens Axboe, Yang Yingliang, Masahiro Yamada, Dan Carpenter
  Cc: linuxppc-dev, linux-kernel, xen-devel, ocfs2-devel, Chen Huang

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>
---
 arch/powerpc/kernel/rtas-proc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 6857a5b0a1c3..117886782ebd 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -259,7 +259,6 @@ __initcall(proc_rtas_init);
 static int parse_number(const char __user *p, size_t count, u64 *val)
 {
 	char buf[40];
-	char *end;
 
 	if (count > 39)
 		return -EINVAL;
@@ -269,11 +268,7 @@ static int parse_number(const char __user *p, size_t count, u64 *val)
 
 	buf[count] = 0;
 
-	*val = simple_strtoull(buf, &end, 10);
-	if (*end && *end != '\n')
-		return -EINVAL;
-
-	return 0;
+	return kstrtoull(buf, 10, val);
 }
 
 /* ****************************************************************** */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-27 15:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26  9:20 [PATCH -next 1/3] powerpc/rtas: Replaced simple_strtoull() with kstrtoull() Chen Huang
2021-05-26  9:20 ` Chen Huang
2021-05-26  9:20 ` [Ocfs2-devel] " Chen Huang
2021-05-26  9:20 ` [PATCH -next 2/3] xen: balloon: " Chen Huang
2021-05-26  9:20   ` Chen Huang
2021-05-26  9:20   ` [Ocfs2-devel] " Chen Huang
2021-05-27 14:10   ` David Laight
2021-05-27 14:10     ` David Laight
2021-05-27 14:10     ` [Ocfs2-devel] " David Laight
2021-05-27 14:37     ` Dan Carpenter
2021-05-27 14:37       ` Dan Carpenter
2021-05-27 14:37       ` [Ocfs2-devel] " Dan Carpenter
2021-05-26  9:20 ` [PATCH -next 3/3] ocfs2: " Chen Huang
2021-05-26  9:20   ` Chen Huang
2021-05-26  9:20   ` [Ocfs2-devel] " Chen Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.