mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 18:10:59 -04:00
drm/amd/pm: fix error handling
clang static analysis reports this error
amdgpu_smu.c:2289:9: warning: Called function pointer
is null (null dereference)
return smu->ppt_funcs->emit_clk_levels(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is a logic error in the earlier check of
emit_clk_levels. The error value is set to
the ret variable but ret is never used. Return
directly and remove the unneeded ret variable.
Fixes: 5d64f9bbb6 ("amdgpu/pm: Implement new API function "emit" that accepts buffer base and write offset")
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -2279,7 +2279,6 @@ static int smu_emit_ppclk_levels(void *handle, enum pp_clock_type type, char *bu
|
||||
{
|
||||
struct smu_context *smu = handle;
|
||||
enum smu_clk_type clk_type;
|
||||
int ret = 0;
|
||||
|
||||
clk_type = smu_convert_to_smuclk(type);
|
||||
if (clk_type == SMU_CLK_COUNT)
|
||||
@@ -2289,7 +2288,7 @@ static int smu_emit_ppclk_levels(void *handle, enum pp_clock_type type, char *bu
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!smu->ppt_funcs->emit_clk_levels)
|
||||
ret = -ENOENT;
|
||||
return -ENOENT;
|
||||
|
||||
return smu->ppt_funcs->emit_clk_levels(smu, clk_type, buf, offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user