[Intel-gfx] [PATCH] drm/i915: Don't pass stack garbage to pcode in the second data register

Ville Syrjala ville.syrjala at linux.intel.com
Wed Jul 10 13:49:37 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Zero initialize val2 so that we don't pass stack garbage to
the pcode qgv read command. I suspect in this case pcode
just ignores the initial value in that registers, but better
safe than sorry.

Cc: Dan Carpenter <dan.carpenter at oracle.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index 7b908e10d32e..ee52c5b4643b 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -65,7 +65,7 @@ static int icl_pcode_read_qgv_point_info(struct drm_i915_private *dev_priv,
 					 struct intel_qgv_point *sp,
 					 int point)
 {
-	u32 val = 0, val2;
+	u32 val = 0, val2 = 0;
 	int ret;
 
 	ret = sandybridge_pcode_read(dev_priv,
-- 
2.21.0



More information about the Intel-gfx mailing list