From b684822a44469fe44b80aef5cdca52cd979a4ecb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 18 Mar 2020 20:25:18 +0200 Subject: [PATCH] drm: Skip drm_mode_config_validate() for !modeset MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit drm_mode_config_init() may not have been called when the driver/device doesn't support modeset. That will cause drm_mode_config_validate() to oops. Skip the validation for !modeset. TODO: We may want to consider calling drm_mode_config_init() unconditionally to avoid similar issues elsewhere... Fixes: 74d2aacbe840 ("drm: Validate encoder->possible_clones") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200318182518.31618-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson --- drivers/gpu/drm/drm_mode_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 55322d7048f57..e1ec1bb7068df 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -608,6 +608,9 @@ void drm_mode_config_validate(struct drm_device *dev) { struct drm_encoder *encoder; + if (!drm_core_check_feature(dev, DRIVER_MODESET)) + return; + drm_for_each_encoder(encoder, dev) fixup_encoder_possible_clones(encoder); -- 2.39.5