]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu: fix MAX_ORDER usage in __iommu_dma_alloc_pages()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 15 Mar 2023 11:31:32 +0000 (14:31 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 5 Apr 2023 23:02:22 +0000 (16:02 -0700)
commitd878657ecef6f6357b55202b656078fd900eea7b
treeb06e2dd631ff7d15cf84c6081edfb0d4583b52ad
parente9bd955533f5f2f0fed2c4f0ca997ca488f2e562
iommu: fix MAX_ORDER usage in __iommu_dma_alloc_pages()

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

Fix MAX_ORDER usage in __iommu_dma_alloc_pages().

Also use GENMASK() instead of hard to read "(2U << order) - 1" magic.

Link: https://lkml.kernel.org/r/20230315113133.11326-10-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/iommu/dma-iommu.c