diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f1acd1889d37..41553e9e57a9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -947,7 +947,8 @@ discard_ggtt_vma(struct i915_vma *vma, const struct i915_ggtt_view *view) rb_erase(&vma->obj_node, &obj->vma.tree); vma->ggtt_view = discard; - GEM_BUG_ON(i915_vma_compare(vma, vma->vm, view)); + GEM_BUG_ON(i915_vma_compare(vma, vma->vm, &discard)); + GEM_BUG_ON(i915_vma_compare(vma, vma->vm, view) == 0); rb = NULL; p = &obj->vma.tree.rb_node;