mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/amdgpu/pm: Check the return value of smum_send_msg_to_smc
[ Upstream commit 579f0c21baec9e7506b6bb3f60f0a9b6d07693b4 ] Check the return value of smum_send_msg_to_smc, otherwise we might use an uninitialized variable "now" Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Reviewed-by: Tim Huang <Tim.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cbf1a8ee11
commit
ec0c1056f2
@@ -1036,7 +1036,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case PP_SCLK:
|
case PP_SCLK:
|
||||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now);
|
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* driver only know min/max gfx_clk, Add level 1 for all other gfx clks */
|
/* driver only know min/max gfx_clk, Add level 1 for all other gfx clks */
|
||||||
if (now == data->gfx_max_freq_limit/100)
|
if (now == data->gfx_max_freq_limit/100)
|
||||||
@@ -1057,7 +1059,9 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
|||||||
i == 2 ? "*" : "");
|
i == 2 ? "*" : "");
|
||||||
break;
|
break;
|
||||||
case PP_MCLK:
|
case PP_MCLK:
|
||||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency, &now);
|
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency, &now);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
for (i = 0; i < mclk_table->count; i++)
|
for (i = 0; i < mclk_table->count; i++)
|
||||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user