Skip to content

Commit 714e08c

Browse files
haitaohuanghtejun
authored andcommitted
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: Haitao Huang <haitao.huang@linux.intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 32bf85c commit 714e08c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/cgroup/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount)
142142
struct misc_cg *i, *j;
143143
int ret;
144144
struct misc_res *res;
145-
s64 new_usage;
145+
u64 new_usage;
146146

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

0 commit comments

Comments
 (0)