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:
parent
934487e98f
commit
668a89907c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user