Skip to content

Commit

Permalink
kernel/res_counter.c: replace simple_strtoull by kstrtoull
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
Fabian Frederick authored and Linus Torvalds committed Jun 4, 2014
1 parent cac92ba commit 6c5a53c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/res_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6c5a53c

Please sign in to comment.