aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill A. Shutemov <[email protected]>2023-03-15 14:31:27 +0300
committerAndrew Morton <[email protected]>2023-04-05 19:42:45 -0700
commit50c00d2c686e52c0dd9b5bddc6727f6c442cbcc0 (patch)
tree355052d3d242459b3cc2305ee74f8f09d0f9625c
parent5f29298fba1ad1e7139381e19e09c272db337b13 (diff)
drm/i915: fix MAX_ORDER usage in i915_gem_object_get_pages_internal()
MAX_ORDER is not inclusive: the maximum allocation order buddy allocator can deliver is MAX_ORDER-1. Fix MAX_ORDER usage in i915_gem_object_get_pages_internal(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Tvrtko Ursulin <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--drivers/gpu/drm/i915/gem/i915_gem_internal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c
index 6bc26b4b06b8..eae9e9f6d3bf 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c
@@ -36,7 +36,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
struct sg_table *st;
struct scatterlist *sg;
unsigned int npages; /* restricted by sg_alloc_table */
- int max_order = MAX_ORDER;
+ int max_order = MAX_ORDER - 1;
unsigned int max_segment;
gfp_t gfp;