[Intel-gfx] [PATCH v2 02/25] drm/i915/selftest: Fix error handling in igt_vma_remapped_gtt()

Imre Deak imre.deak at intel.com
Thu Mar 25 21:47:45 UTC 2021


An inner scope version of err shadows the variable in the outer scope,
and err doesn't get set after a failure, fix these.

Signed-off-by: Imre Deak <imre.deak at intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
index 1b6125e4c1ac6..35481cfbb6353 100644
--- a/drivers/gpu/drm/i915/selftests/i915_vma.c
+++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
@@ -890,7 +890,6 @@ static int igt_vma_remapped_gtt(void *arg)
 			struct i915_vma *vma;
 			u32 __iomem *map;
 			unsigned int x, y;
-			int err;
 
 			i915_gem_object_lock(obj, NULL);
 			err = i915_gem_object_set_to_gtt_domain(obj, true);
@@ -962,6 +961,7 @@ static int igt_vma_remapped_gtt(void *arg)
 						       *t == I915_GGTT_VIEW_ROTATED ? "Rotated" : "Remapped",
 						       val, exp);
 						i915_vma_unpin_iomap(vma);
+						err = -EINVAL;
 						goto out;
 					}
 				}
-- 
2.25.1



More information about the Intel-gfx mailing list