Skip to contentSkip to conversation

drm/amdgpu: Fix missing assignment to variable r

PATCH In review Colin Ian King 2 participants 2 messages Feb 24, 2022 – Feb 25, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix missing assignment to variable r

Currently the call to function amdgpu_benchmark_move should be assigning the return value to variable r as this is checked in the next statement, however, this assignment is missing. Fix this by adding in the missing assignment.

Addresses clang scan warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c:168:7: warning:
variable 'r' is uninitialized when used here [-Wuninitialized]

Fixes 9645c9c9fb15 ("drm/amdgpu: plumb error handling though amdgpu_benchmark()")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c +1 -1
index 3136a9ad2d54..bb293a5c6fd5 100644
@@ -163,7 +163,7 @@ int amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
 			 "benchmark test: %d (simple test, VRAM to VRAM)\n",
 			 test_number);
 		/* simple test, VRAM to VRAM */
-		amdgpu_benchmark_move(adev, 1024*1024, AMDGPU_GEM_DOMAIN_VRAM,
+		r = amdgpu_benchmark_move(adev, 1024*1024, AMDGPU_GEM_DOMAIN_VRAM,
 				      AMDGPU_GEM_DOMAIN_VRAM);
 		if (r)
 			goto done;
Signature · 1 line
2.34.1
#1 lore raw

Already fixed. Thanks for the patch.

Alex

Quoted 32 lines · Colin Ian King

Currently the call to function amdgpu_benchmark_move should be assigning the return value to variable r as this is checked in the next statement, however, this assignment is missing. Fix this by adding in the missing assignment.

Addresses clang scan warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c:168:7: warning:
variable 'r' is uninitialized when used here [-Wuninitialized]

Fixes 9645c9c9fb15 ("drm/amdgpu: plumb error handling though amdgpu_benchmark()")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c +1 -2
index 3136a9ad2d54..bb293a5c6fd5 100644
@@ -163,7 +163,7 @@ int amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
                         "benchmark test: %d (simple test, VRAM to VRAM)\n",
                         test_number);
                /* simple test, VRAM to VRAM */
-               amdgpu_benchmark_move(adev, 1024*1024, AMDGPU_GEM_DOMAIN_VRAM,
+               r = amdgpu_benchmark_move(adev, 1024*1024, AMDGPU_GEM_DOMAIN_VRAM,
                                      AMDGPU_GEM_DOMAIN_VRAM);
                if (r)
                        goto done;
--

2.34.1