提交 fda519fb 编写于 作者: T Tom St Denis 提交者: Alex Deucher

drm/amd/powerplay: Zero out power data in AMDGPU_PP_SENSOR_GPU_POWER readout

Since 12 of the 16 bytes are not initialized with anything let's ensure they're
sensibly zeroed out otherwise debugfs callers will read back garbage
(because they assume debugfs wrote sensible data back...)
Signed-off-by: NTom St Denis <tom.stdenis@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 cf8c19a3
...@@ -3889,7 +3889,9 @@ static int vega10_get_gpu_power(struct pp_hwmgr *hwmgr, ...@@ -3889,7 +3889,9 @@ static int vega10_get_gpu_power(struct pp_hwmgr *hwmgr,
return -EINVAL); return -EINVAL);
vega10_read_arg_from_smc(hwmgr, &value); vega10_read_arg_from_smc(hwmgr, &value);
/* power value is an integer */ /* power value is an integer */
memset(query, 0, sizeof *query);
query->average_gpu_power = value << 8; query->average_gpu_power = value << 8;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册