History

mm/page_alloc: restrict and formalize compound_page_dtors[]

Restrict elements in compound_page_dtors[] array per NR_COMPOUND_DTORS and explicitly position them according to enum compound_dtor_id. This improves protection against possible misalignment between compound_page_dtors[] and enum compound_dtor_id later on.

Anshuman Khandual committed 6 years ago

Commit ae70edd1 parent aa092592 files · +6 −6Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/mm.h+1−1
@@ -867,7 +867,7 @@ enum compound_dtor_id { · 866 unmodified lines
867867 #endif
868868 NR_COMPOUND_DTORS,
869869 };
870−extern compound_page_dtor * const compound_page_dtors[];
870+extern compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS];
871871
872872 static inline void set_compound_page_dtor(struct page *page,
873873 enum compound_dtor_id compound_dtor)