提交 dae37a5d 编写于 作者: M Miaohe Lin 提交者: Andrew Morton

mm/page_alloc: init local variable buddy_pfn

The local variable buddy_pfn could be passed to buddy_merge_likely()
without initialization if the passed in order is MAX_ORDER - 1.  This
looks buggy but buddy_pfn won't be used in this case as there's a order >=
MAX_ORDER - 2 check.  Init buddy_pfn to 0 anyway to avoid possible future
misuse.

Link: https://lkml.kernel.org/r/20220916072257.9639-14-linmiaohe@huawei.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: NOscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 c940e020
...@@ -1113,7 +1113,7 @@ static inline void __free_one_page(struct page *page, ...@@ -1113,7 +1113,7 @@ static inline void __free_one_page(struct page *page,
int migratetype, fpi_t fpi_flags) int migratetype, fpi_t fpi_flags)
{ {
struct capture_control *capc = task_capc(zone); struct capture_control *capc = task_capc(zone);
unsigned long buddy_pfn; unsigned long buddy_pfn = 0;
unsigned long combined_pfn; unsigned long combined_pfn;
struct page *buddy; struct page *buddy;
bool to_tail; bool to_tail;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册