All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/atomic: fix null pointer access to mode_fixup callback
@ 2015-08-11 12:00 Inki Dae
  2015-08-11 12:15 ` Maarten Lankhorst
  0 siblings, 1 reply; 2+ messages in thread
From: Inki Dae @ 2015-08-11 12:00 UTC (permalink / raw)
  To: dri-devel; +Cc: daniel.vetter

This patch fixes null pointer access incurred when
encoder driver didn't set its own mode_fixup callback.

mode_fixup callback shoudn't be called if the callback
of drm_encoder_helper_funcs is NULL.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5b59d5ad..b69469c 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -299,6 +299,9 @@ mode_fixup(struct drm_atomic_state *state)
 				return ret;
 			}
 		} else {
+			if (!funcs->mode_fixup)
+				continue;
+
 			ret = funcs->mode_fixup(encoder, &crtc_state->mode,
 						&crtc_state->adjusted_mode);
 			if (!ret) {
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-08-11 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 12:00 [PATCH] drm/atomic: fix null pointer access to mode_fixup callback Inki Dae
2015-08-11 12:15 ` Maarten Lankhorst

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.