]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: check return status before using stable_pstate
authorTom Rix <trix@redhat.com>
Mon, 14 Feb 2022 18:22:24 +0000 (10:22 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Feb 2022 21:44:40 +0000 (16:44 -0500)
commit590834f2f791f415d4b3383f76b99c80627610e7
tree08e1b89e20edad2f3276d21426eb13d18069e968
parentbb3022e09e65fb4d0cf5a7fa0da0ed395541c4bc
drm/amdgpu: check return status before using stable_pstate

Clang static analysis reports this problem
amdgpu_ctx.c:616:26: warning: Assigned value is garbage
  or undefined
  args->out.pstate.flags = stable_pstate;
                         ^ ~~~~~~~~~~~~~
amdgpu_ctx_stable_pstate can fail without setting
stable_pstate.  So check.

Fixes: fbe47822deda ("drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c