diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 3f0417f97e7665f514b73280e4bbff2e9608f96a..085d3ae478fe5ac7c89da55b6215a49bd8cd9c4d 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -195,6 +195,10 @@ int res_counter_memparse_write_strategy(const char *buf, if (*end != '\0') return -EINVAL; - *res = PAGE_ALIGN(*res); + if (PAGE_ALIGN(*res) >= *res) + *res = PAGE_ALIGN(*res); + else + *res = RES_COUNTER_MAX; + return 0; }