浏览代码

drm/i915/selftests: Fix uninitialized variable

There is a potential execution path in which variable err is
returned without being properly initialized previously.

Fix this by initializing variable err to 0.

Addresses-Coverity-ID: 1468362 ("Uninitialized scalar variable")
Fixes: f4ecfbfc32ed ("drm/i915: Check whitelist registers across resets")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180424131545.GA4053@embeddedor.com
Gustavo A. R. Silva 7 年之前
父节点
当前提交
a399715913
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpu/drm/i915/selftests/intel_workarounds.c

+ 1 - 1
drivers/gpu/drm/i915/selftests/intel_workarounds.c

@@ -239,7 +239,7 @@ static int live_reset_whitelist(void *arg)
 	struct intel_engine_cs *engine = i915->engine[RCS];
 	struct intel_engine_cs *engine = i915->engine[RCS];
 	struct i915_gpu_error *error = &i915->gpu_error;
 	struct i915_gpu_error *error = &i915->gpu_error;
 	struct whitelist w;
 	struct whitelist w;
-	int err;
+	int err = 0;
 
 
 	/* If we reset the gpu, we should not lose the RING_NONPRIV */
 	/* If we reset the gpu, we should not lose the RING_NONPRIV */