diff options
-rw-r--r-- | kernel/res_counter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 3f0417f97e76..085d3ae478fe 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c | |||
@@ -195,6 +195,10 @@ int res_counter_memparse_write_strategy(const char *buf, | |||
195 | if (*end != '\0') | 195 | if (*end != '\0') |
196 | return -EINVAL; | 196 | return -EINVAL; |
197 | 197 | ||
198 | *res = PAGE_ALIGN(*res); | 198 | if (PAGE_ALIGN(*res) >= *res) |
199 | *res = PAGE_ALIGN(*res); | ||
200 | else | ||
201 | *res = RES_COUNTER_MAX; | ||
202 | |||
199 | return 0; | 203 | return 0; |
200 | } | 204 | } |