[PATCH] drm: fixes crct set_mode when encoder mode_fixup is null.
Carlos Palminha
CARLOS.PALMINHA at synopsys.com
Wed Feb 10 12:15:22 UTC 2016
Avoids null crash when encoders don't implement mode_fixup.
Signed-off-by: Carlos Palminha <palminha at synopsys.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index a02a7f9..ef3def7 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -328,10 +328,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
}
encoder_funcs = encoder->helper_private;
- if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
- adjusted_mode))) {
- DRM_DEBUG_KMS("Encoder fixup failed\n");
- goto done;
+ if (encoder_funcs->mode_fixup) {
+ if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
+ adjusted_mode))) {
+ DRM_DEBUG_KMS("Encoder fixup failed\n");
+ goto done;
+ }
}
}
--
2.5.0
More information about the dri-devel
mailing list