|
@@ -186,8 +186,11 @@ int res_counter_memparse_write_strategy(const char *buf,
|
|
|
|
|
|
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
|
|
/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
|
|
if (*buf == '-') {
|
|
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;
|
|
return -EINVAL;
|
|
*resp = RES_COUNTER_MAX;
|
|
*resp = RES_COUNTER_MAX;
|
|
return 0;
|
|
return 0;
|