All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] drm/i915/selftest: fix an error return path where err is not being set
@ 2020-07-13 14:25 ` Colin King
  0 siblings, 0 replies; 10+ messages in thread
From: Colin King @ 2020-07-13 14:25 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Chris Wilson, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

There is an error condition where err is not being set and an uninitialized
garbage value in err is being returned.  Fix this by assigning err to an
appropriate error return value before taking the error exit path.

Addresses-Coverity: ("Uninitialized scalar value")
Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
index deb6dec1b5ab..7aa73bb03381 100644
--- a/drivers/gpu/drm/i915/selftests/i915_perf.c
+++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
@@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
 	cs = intel_ring_begin(rq, 2 * 32 + 2);
 	if (IS_ERR(cs)) {
 		i915_request_add(rq);
+		err = PTR_ERR(cs);
 		goto out_rq;
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-13 16:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13 14:25 [PATCH][next] drm/i915/selftest: fix an error return path where err is not being set Colin King
2020-07-13 14:25 ` [Intel-gfx] " Colin King
2020-07-13 14:25 ` Colin King
2020-07-13 14:25 ` Colin King
2020-07-13 14:46 ` Chris Wilson
2020-07-13 14:46   ` [Intel-gfx] " Chris Wilson
2020-07-13 14:46   ` Chris Wilson
2020-07-13 14:46   ` Chris Wilson
2020-07-13 15:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-07-13 16:32 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.