]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/pm: fix error handling
authorTom Rix <trix@redhat.com>
Sat, 5 Feb 2022 15:00:08 +0000 (07:00 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Feb 2022 23:03:50 +0000 (18:03 -0500)
commitdaa0bd60c89bf7f469f74d6e973313d8a976f2f1
tree293eacee92453f1b34c2e7fc6e616d185ffeb73f
parent8d3e0f7b8cb3198876a2a078be47e3b876c52a88
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: b474240cebf1 ("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>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c