[PATCH] drm/amdgpu: fix regression in amdgpu_ucode_init_bo

Christian König deathsimple at vodafone.de
Wed Sep 14 14:58:21 UTC 2016


From: Christian König <christian.koenig at amd.com>

Going into the error case when everything works is a bad idea.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 4a5c211..7a05f79 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -283,6 +283,7 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
 			fw_offset += ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE);
 		}
 	}
+	return 0;
 
 failed_kmap:
 	amdgpu_bo_unpin(*bo);
@@ -291,8 +292,7 @@ failed_pin:
 failed_reserve:
 	amdgpu_bo_unref(bo);
 failed:
-	if (err)
-		adev->firmware.smu_load = false;
+	adev->firmware.smu_load = false;
 
 	return err;
 }
-- 
2.5.0



More information about the amd-gfx mailing list