mirror of https://gitee.com/openkylin/linux.git
68c3bd9501
clang warns (trimmed for brevity):
drivers/gpu/drm/amd/amdgpu/../powerplay/smu_v11_0.c:1098:10: warning:
variable 'freq' is used uninitialized whenever '?:' condition is false
[-Wsometimes-uninitialized]
ret = smu_get_current_clk_freq_by_table(smu, clk_id, &freq);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If get_current_clk_freq_by_table is ever NULL, freq will fail to be
properly initialized. Zero initialize it to avoid using uninitialized
stack values.
smu_get_current_clk_freq_by_table expands to a ternary operator
conditional on smu->funcs->get_current_clk_freq_by_table being not NULL.
When this is false, freq will be uninitialized. Zero initialize freq to
avoid using random stack values if that ever happens.
Fixes:
|
||
---|---|---|
.. | ||
hwmgr | ||
inc | ||
smumgr | ||
Makefile | ||
amd_powerplay.c | ||
amdgpu_smu.c | ||
navi10_ppt.c | ||
navi10_ppt.h | ||
smu_v11_0.c | ||
vega20_ppt.c | ||
vega20_ppt.h |