From: Haitao Huang Date: Fri, 21 Jul 2023 12:02:31 +0000 (-0700) Subject: cgroup/misc: Store atomic64_t reads to u64 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=714e08cc3ec564dc1717000f5a4c1f40ca8c8878;p=linux.git 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 Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c index abbe9aa5cdd17..79a3717a5803a 100644 --- a/kernel/cgroup/misc.c +++ b/kernel/cgroup/misc.c @@ -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;