linux_dsm_epyc7002/drivers/gpu/drm/amd
Nathan Chancellor 985863d00a drm/amd/powerplay: Zero initialize current_rpm in vega20_get_fan_speed_percent
clang warns (trimmed for brevity):

drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:3023:8: warning:
variable 'current_rpm' is used uninitialized whenever '?:' condition is
false [-Wsometimes-uninitialized]
        ret = smu_get_current_rpm(smu, &current_rpm);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

smu_get_current_rpm expands to a ternary operator conditional on
smu->funcs->get_current_rpm being not NULL. When this is false,
current_rpm will be uninitialized. Zero initialize current_rpm to
avoid using random stack values if that ever happens.

Fixes: ee0db82027 ("drm/amd/powerplay: move PPTable_t uses into asic level")
Link: https://github.com/ClangBuiltLinux/linux/issues/588
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2019-07-08 13:56:18 -05:00
..
acp treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
amdgpu drm/amdgpu/mes10.1: Fix header guard 2019-07-08 13:56:02 -05:00
amdkfd drm/amdkfd: Disable idle optimization for chained runlist 2019-07-03 14:32:10 -05:00
display drm/amdgpu: Use kmemdup rather than duplicating its implementation 2019-07-05 15:54:55 -05:00
include drm/amd/powerplay: make athub pg bit configured by pg_flags 2019-06-25 13:54:32 -05:00
powerplay drm/amd/powerplay: Zero initialize current_rpm in vega20_get_fan_speed_percent 2019-07-08 13:56:18 -05:00