Much like with the equivalent gen8_alloc_va_range. Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 180dbd8..5589a8d 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -1857,7 +1857,8 @@ static int gen6_alloc_va_range(struct i915_address_space *vm, uint32_t pde, temp; int ret; - if (WARN_ON(start_in + length_in > ppgtt->base.total)) + if (WARN_ON(start_in > ppgtt->base.total || length_in > + ppgtt->base.total - start_in)) return -ENODEV; start = start_save = start_in; -- 2.4.11 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx