From: Fabian Frederick Date: Wed, 4 Jun 2014 23:11:24 +0000 (-0700) Subject: kernel/res_counter.c: replace simple_strtoull by kstrtoull X-Git-Tag: firefly_0821_release~176^2~3785^2~16^2~58 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6c5a53c67057bddf7f8e26c93a8e045215f61539;p=firefly-linux-kernel-4.4.55.git kernel/res_counter.c: replace simple_strtoull by kstrtoull [akpm@linux-foundation.org: don't overwrite kstrtoull()'s errno] Signed-off-by: Fabian Frederick Cc: Michal Hocko Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 51dbac6a3633..e791130f85a7 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -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;