drm/amdgpu: fix regression in amdgpu_ucode_init_bo

Submitted by Christian König on Sept. 14, 2016, 2:58 p.m.

Details

Message ID 1473865101-1952-1-git-send-email-deathsimple@vodafone.de
State New
Headers show
Series "drm/amdgpu: fix regression in amdgpu_ucode_init_bo" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Christian König Sept. 14, 2016, 2:58 p.m.
From: Christian König <christian.koenig@amd.com>

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

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

Patch hide | download patch | download mbox

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;
 }

Comments

On Wed, Sep 14, 2016 at 10:58 AM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Going into the error case when everything works is a bad idea.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
On Wed, Sep 14, 2016 at 04:58:21PM +0200, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
> 
> Going into the error case when everything works is a bad idea.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---

Christian, thanks.

Acked-by: Huang Rui <ray.huang@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
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx