]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Fix realloc of ptr
authorTom Rix <trix@redhat.com>
Sun, 27 Feb 2022 15:33:42 +0000 (07:33 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Mar 2022 23:40:05 +0000 (18:40 -0500)
commit44ba6c84395b77117e113566d5b7d6fc72a2c7d0
tree901d84db449ba9091a5085212ee8be2106f1f5df
parente5c7b681290afd0566e3d6f6af24e6bcafb60044
drm/amdgpu: Fix realloc of ptr

Clang static analysis reports this error
amdgpu_debugfs.c:1690:9: warning: 1st function call
  argument is an uninitialized value
  tmp = krealloc_array(tmp, i + 1,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

realloc uses tmp, so tmp can not be garbage.
And the return needs to be checked.

Fixes: e17b5f2a6d79 ("drm/amdgpu: add debugfs for reset registers list")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c