ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH -next 1/3] powerpc/rtas: Replaced simple_strtoull() with kstrtoull()
@ 2021-05-26  9:20 Chen Huang
  2021-05-26  9:20 ` [Ocfs2-devel] [PATCH -next 2/3] xen: balloon: " Chen Huang
  2021-05-26  9:20 ` [Ocfs2-devel] [PATCH -next 3/3] ocfs2: " Chen Huang
  0 siblings, 2 replies; 5+ 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: xen-devel, Chen Huang, linuxppc-dev, linux-kernel, ocfs2-devel

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


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

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

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).