Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c5a53c6 authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds
Browse files

kernel/res_counter.c: replace simple_strtoull by kstrtoull



[akpm@linux-foundation.org: don't overwrite kstrtoull()'s errno]
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cac92ba7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -186,8 +186,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;