kernel/res_counter.c: replace simple_strtoull by kstrtoull
[akpm@linux-foundation.org: don't overwrite kstrtoull()'s errno] Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Michal Hocko <mhocko@suse.cz> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
cac92ba74f
commit
6c5a53c670
1 changed files with 5 additions and 2 deletions
|
@ -186,8 +186,11 @@ int res_counter_memparse_write_strategy(const char *buf,
|
||||||
|
|
||||||
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
|
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
|
||||||
if (*buf == '-') {
|
if (*buf == '-') {
|
||||||
res = simple_strtoull(buf + 1, &end, 10);
|
int rc = kstrtoull(buf + 1, 10, &res);
|
||||||
if (res != 1 || *end != '\0')
|
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
if (res != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
*resp = RES_COUNTER_MAX;
|
*resp = RES_COUNTER_MAX;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue