From: Aurabindo Pillai <[email protected]>

[Why&How]
Bug was caused when moving variable from stack to heap because it was reusable
and garbage was left over, so we need to zero mem.

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Alan Liu <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Martin Leung <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
index 3d184679f129..ae6e6abc620b 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
@@ -3192,6 +3192,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct 
display_mode_lib *mode_l
                                                        
mode_lib->vba.FCLKChangeLatency, mode_lib->vba.UrgLatency[i],
                                                        
mode_lib->vba.SREnterPlusExitTime);
 
+                                       
memset(&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull, 0, 
sizeof(DmlPipe));
                                        
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.Dppclk = 
mode_lib->vba.RequiredDPPCLK[i][j][k];
                                        
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.Dispclk = 
mode_lib->vba.RequiredDISPCLK[i][j];
                                        
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.PixelClock = 
mode_lib->vba.PixelClock[k];
-- 
2.25.1

Reply via email to