[PATCH 02/10] drm/amdgpu: handle runtime pm correctly in amdgpu_driver_open_kms
Michel Dänzer
michel at daenzer.net
Thu Sep 1 01:04:00 UTC 2016
On 01/09/16 07:08 AM, Alex Deucher wrote:
> Need to fix the error pathes.
Typo? "pathes"
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 45f98b4..c2c7fb1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -542,12 +542,16 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
> return r;
>
> fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
> - if (unlikely(!fpriv))
> - return -ENOMEM;
> + if (unlikely(!fpriv)) {
> + r = -ENOMEM;
> + goto out_suspend;
> + }
>
> r = amdgpu_vm_init(adev, &fpriv->vm);
> - if (r)
> - goto error_free;
> + if (r) {
> + kfree(fpriv);
> + goto out_suspend;
> + }
>
> mutex_init(&fpriv->bo_list_lock);
> idr_init(&fpriv->bo_list_handles);
> @@ -556,12 +560,9 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
>
> file_priv->driver_priv = fpriv;
>
> +out_suspend:
> pm_runtime_mark_last_busy(dev->dev);
> pm_runtime_put_autosuspend(dev->dev);
> - return 0;
> -
> -error_free:
> - kfree(fpriv);
This patch and patch 7 are
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list