summaryrefslogtreecommitdiff
path: root/kernel/res_counter.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2014-05-16 16:27:24 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-05-16 16:27:27 +1000
commit64acc0549fea1b404b88c1354813886364902488 (patch)
treea90961be933d562e42a0e592ead836a225653e65 /kernel/res_counter.c
parent0856ad1ef175c45dc6a0bc629ca355fdfbb1001e (diff)
parent6456b00c4f4ac3774506ff54242a8849172cb650 (diff)
Merge branch 'akpm-current/current'
Conflicts: arch/x86/kernel/apic/hw_nmi.c mm/memblock.c mm/memcontrol.c
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;