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
[[email protected]: don't overwrite kstrtoull()'s errno]
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and 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.