From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 02/10] drm/amdgpu: handle runtime pm correctly in amdgpu_driver_open_kms
Date: Wed, 31 Aug 2016 18:08:48 -0400 [thread overview]
Message-ID: <1472681336-30106-2-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1472681336-30106-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
Need to fix the error pathes.
Signed-off-by: Alex Deucher <alexander.deucher@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);
return r;
}
--
2.5.5
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2016-08-31 22:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 22:08 [PATCH 01/10] drm/amdgpu: handle runtime pm in drm pre/post close Alex Deucher
[not found] ` <1472681336-30106-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-08-31 22:08 ` Alex Deucher [this message]
[not found] ` <1472681336-30106-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-01 1:04 ` [PATCH 02/10] drm/amdgpu: handle runtime pm correctly in amdgpu_driver_open_kms Michel Dänzer
2016-08-31 22:08 ` [PATCH 03/10] drm/amdgpu: handle runtime pm in fbcon Alex Deucher
[not found] ` <1472681336-30106-3-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-01 1:04 ` Michel Dänzer
[not found] ` <c2ff0619-5d11-c443-a1b4-b57530dc89f6-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-01 20:44 ` Alex Deucher
[not found] ` <CADnq5_P+HQ=7LQfFjG8dLihbGsEKnLZFNmeFeUdL79VvuwyqdA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-02 1:47 ` Michel Dänzer
[not found] ` <38837769-4dfc-8a19-b6de-c5d18014c889-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-02 13:31 ` Deucher, Alexander
2016-08-31 22:08 ` [PATCH 04/10] drm/amdgpu: skip suspend/resume on DRM_SWITCH_POWER_DYNAMIC_OFF Alex Deucher
[not found] ` <1472681336-30106-4-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-01 1:06 ` Michel Dänzer
2016-08-31 22:08 ` [PATCH 05/10] drm/amdgpu: set runtime pm state to active on resume Alex Deucher
2016-08-31 22:08 ` [PATCH 06/10] drm/radeon: handle runtime pm in drm pre/post close Alex Deucher
2016-08-31 22:08 ` [PATCH 07/10] drm/radeon: handle runtime pm correctly in amdgpu_driver_open_kms Alex Deucher
2016-08-31 22:08 ` [PATCH 08/10] drm/radeon: handle runtime pm in fbcon Alex Deucher
2016-08-31 22:08 ` [PATCH 09/10] drm/radeon: skip suspend/resume on DRM_SWITCH_POWER_DYNAMIC_OFF Alex Deucher
2016-08-31 22:08 ` [PATCH 10/10] drm/radeon: set runtime pm state to active on resume Alex Deucher
2016-09-01 1:03 ` [PATCH 01/10] drm/amdgpu: handle runtime pm in drm pre/post close Michel Dänzer
[not found] ` <6648435f-d52e-e4d3-55f4-df1837b3b8a8-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-01 20:38 ` Alex Deucher
[not found] ` <CADnq5_N3e=xLhziKFKJog9vodd-=0sG4o2xW+kqU9ck+jFtMYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-02 1:50 ` Michel Dänzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1472681336-30106-2-git-send-email-alexander.deucher@amd.com \
--to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox