Commit 714e08cc authored by Haitao Huang's avatar Haitao Huang Committed by Tejun Heo
Browse files

cgroup/misc: Store atomic64_t reads to u64



Change 'new_usage' type to u64 so it can be compared with unsigned 'max'
and 'capacity' properly even if the value crosses the signed boundary.

Signed-off-by: default avatarHaitao Huang <haitao.huang@linux.intel.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 32bf85c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount)
	struct misc_cg *i, *j;
	int ret;
	struct misc_res *res;
	s64 new_usage;
	u64 new_usage;

	if (!(valid_type(type) && cg && READ_ONCE(misc_res_capacity[type])))
		return -EINVAL;