提交 6c5a53c6 编写于 作者: F Fabian Frederick 提交者: Linus Torvalds

kernel/res_counter.c: replace simple_strtoull by kstrtoull

[akpm@linux-foundation.org: don't overwrite kstrtoull()'s errno]
Signed-off-by: NFabian Frederick <fabf@skynet.be>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cac92ba7
......@@ -186,8 +186,11 @@ int res_counter_memparse_write_strategy(const char *buf,
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
if (*buf == '-') {
res = simple_strtoull(buf + 1, &end, 10);
if (res != 1 || *end != '\0')
int rc = kstrtoull(buf + 1, 10, &res);
if (rc)
return rc;
if (res != 1)
return -EINVAL;
*resp = RES_COUNTER_MAX;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册