[Intel-gfx] [bug report] drm/i915: Fill different pages of the GTT
Dan Carpenter
dan.carpenter at oracle.com
Mon Mar 13 09:28:01 UTC 2017
Hello Chris Wilson,
The patch 6e32ab3d4777: "drm/i915: Fill different pages of the GTT"
from Feb 13, 2017, leads to the following static checker warning:
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c:583 walk_hole()
error: 'vma' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
539 vma = i915_vma_instance(obj, vm, NULL);
540 if (IS_ERR(vma)) {
^^^^^^^^^^
541 err = PTR_ERR(vma);
542 goto err;
^^^^^^^^^
543 }
544
545 for (addr = hole_start;
546 addr + obj->base.size < hole_end;
547 addr += obj->base.size) {
548 err = i915_vma_pin(vma, 0, 0, addr | flags);
549 if (err) {
550 pr_err("%s bind failed at %llx + %llx [hole %llx- %llx] with err=%d\n",
551 __func__, addr, vma->size,
552 hole_start, hole_end, err);
553 goto err;
554 }
555 i915_vma_unpin(vma);
556
557 if (!drm_mm_node_allocated(&vma->node) ||
558 i915_vma_misplaced(vma, 0, 0, addr | flags)) {
559 pr_err("%s incorrect at %llx + %llx\n",
560 __func__, addr, vma->size);
561 err = -EINVAL;
562 goto err;
563 }
564
565 err = i915_vma_unbind(vma);
566 if (err) {
567 pr_err("%s unbind failed at %llx + %llx with err=%d\n",
568 __func__, addr, vma->size, err);
569 goto err;
570 }
571
572 GEM_BUG_ON(drm_mm_node_allocated(&vma->node));
573
574 if (igt_timeout(end_time,
575 "%s timed out at %llx\n",
576 __func__, addr)) {
577 err = -EINTR;
578 goto err;
579 }
580 }
581
582 err:
583 if (!i915_vma_is_ggtt(vma))
^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside function call.
regards,
dan carpenter
More information about the Intel-gfx
mailing list