Messages in this thread | | | From | Muchun Song <> | Date | Fri, 3 Dec 2021 15:43:37 +0800 | Subject | Re: [PATCH] hugetlb/cgroup: Fix copy/paste array assignment |
| |
On Fri, Dec 3, 2021 at 2:56 PM Kees Cook <keescook@chromium.org> wrote: > > Fix mismatched array assignment, reported by an -Warray-bounds build: > > mm/hugetlb_cgroup.c: In function '__hugetlb_cgroup_file_legacy_init': > mm/hugetlb_cgroup.c:850:35: error: array subscript 8 is above array bounds of 'struct cftype[8]' [-Werror=array-bounds ] > 850 | cft = &h->cgroup_files_dfl[8]; > | ~~~~~~~~~~~~~~~~~~~^~~ > In file included from mm/hugetlb_cgroup.c:23: > ./include/linux/hugetlb.h:625:23: note: while referencing 'cgroup_files_dfl' > 625 | struct cftype cgroup_files_dfl[8]; > | ^~~~~~~~~~~~~~~~ > > Fixes: e45f4726bcad ("hugetlb: add hugetlb.*.numa_stat file") > Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Thanks.
| |