• Tom Rix's avatar
    drm/amd/pm: fix error handling · 6cbdf12b
    Tom Rix authored
    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: 5d64f9bb ("amdgpu/pm: Implement new API function "emit" that accepts buffer base and write offset")
    Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
    Signed-off-by: default avatarTom Rix <trix@redhat.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    6cbdf12b
amdgpu_smu.c 74.8 KB