summaryrefslogtreecommitdiff
path: root/kernel/res_counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/res_counter.c')
-rw-r--r--kernel/res_counter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index 51dbac6a3633..85ea94305015 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -136,6 +136,8 @@ res_counter_member(struct res_counter *counter, int member)
return &counter->failcnt;
case RES_SOFT_LIMIT:
return &counter->soft_limit;
+ case RES_LOW_LIMIT:
+ return &counter->low_limit;
};
BUG();
@@ -186,8 +188,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;