mm/page_reporting: fix MAX_ORDER usage in page_reporting_register()

MAX_ORDER is not inclusive: the maximum allocation order buddy allocator
can deliver is MAX_ORDER-1.

Fix MAX_ORDER usage in page_reporting_register().

Link: https://lkml.kernel.org/r/20230315113133.11326-8-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Kirill A. Shutemov 2023-03-15 14:31:30 +03:00 committed by Andrew Morton
parent 934487e98f
commit 668a89907c

View File

@ -370,7 +370,7 @@ int page_reporting_register(struct page_reporting_dev_info *prdev)
*/
if (page_reporting_order == -1) {
if (prdev->order > 0 && prdev->order <= MAX_ORDER)
if (prdev->order > 0 && prdev->order < MAX_ORDER)
page_reporting_order = prdev->order;
else
page_reporting_order = pageblock_order;