]> git.baikalelectronics.ru Git - kernel.git/commit
mm/page_alloc: init local variable buddy_pfn
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 16 Sep 2022 07:22:54 +0000 (15:22 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:30 +0000 (14:03 -0700)
commit5f5ae7cc713f9f119fad1b59c0528a9d66ddc670
treef7f65d5a90c88f7d233eca6c715d3f49480ed6ad
parent052059f6ce2e602d126a9334cf465fb63c8d4077
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.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c