Skip to content

Commit 6c5a53c

Browse files
Fabian Fredericktorvalds
authored andcommitted
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>
1 parent cac92ba commit 6c5a53c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kernel/res_counter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ int res_counter_memparse_write_strategy(const char *buf,
186186

187187
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
188188
if (*buf == '-') {
189-
res = simple_strtoull(buf + 1, &end, 10);
190-
if (res != 1 || *end != '\0')
189+
int rc = kstrtoull(buf + 1, 10, &res);
190+
191+
if (rc)
192+
return rc;
193+
if (res != 1)
191194
return -EINVAL;
192195
*resp = RES_COUNTER_MAX;
193196
return 0;

0 commit comments

Comments
 (0)