All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: add check for plane functions
@ 2017-03-17  7:55 Shirish S
       [not found] ` <1489737308-30713-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shirish S @ 2017-03-17  7:55 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Harry.Wentland-5C7GfCeVMHo, shirish.s-5C7GfCeVMHo

update_plane() and disable_plane() functions
assoiciated with setting plane are called
without any check, causing kernel panic.

This patch adds the required check to avoid it.

Change-Id: I0d6792608b33e674c217388aa57c4b7d680d9bc7
Signed-off-by: Shirish S <shirish.s@amd.com>
---
 drivers/gpu/drm/drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 249c0ae..f675f8b 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -456,6 +456,12 @@ static int __setplane_internal(struct drm_plane *plane,
 {
 	int ret = 0;
 
+	if (plane->funcs->disable_plane == NULL ||
+				plane->funcs->update_plane == NULL) {
+		DRM_ERROR("plane funcs not implemented\n");
+		ret = -EPERM;
+		goto out;
+	}
 	/* No fb means shut it down */
 	if (!fb) {
 		plane->old_fb = plane->fb;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-03-21 15:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17  7:55 [PATCH] drm: add check for plane functions Shirish S
     [not found] ` <1489737308-30713-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2017-03-17  9:56   ` Ville Syrjälä
     [not found]     ` <20170317095647.GN31595-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-17 10:16       ` Shirish S
     [not found]         ` <CAE=Z4VBsuzAPWSiy9NSXXFZfWEuSEi0miANhNmq5u0xR6M0BWw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-17 11:08           ` Ville Syrjälä
     [not found]             ` <20170317110843.GQ31595-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-17 16:57               ` Daniel Vetter
     [not found]                 ` <20170317165752.hm6htsx3jlhusx4s-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-03-17 17:19                   ` Ville Syrjälä
2017-03-17 19:29                     ` Eric Anholt
     [not found]                       ` <87k27nsnuw.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
2017-03-20  4:28                         ` Shirish S
     [not found]                           ` <CAE=Z4VBgLWzrNVRkgKJNSmyBuDRrNmTuY3YoVTRKc956mB3TAg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-20  8:21                             ` Daniel Vetter
     [not found]                               ` <20170320082131.kfn7qwihrvz4qdnc-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-03-20  9:42                                 ` Shirish S
     [not found]                                   ` <CAE=Z4VDp4tOhvbkk9OsG7EiG1_rTu8NWqoKUHUFnrVOc8s2Tuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-21 15:27                                     ` Harry Wentland
2017-03-17 20:05   ` Harry Wentland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.