summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/display/vlv_dsi.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-08-16 18:37:20 +0300
committerJani Nikula <jani.nikula@intel.com>2022-08-18 13:10:31 +0300
commitf4a6c7a454a6e71c5ccf25af82694213a9784013 (patch)
treed2a5c27f6a884cefcbef927e24bd09d9071fc5bd /drivers/gpu/drm/i915/display/vlv_dsi.c
parent78f48aa6f50b662bd74607f7415d68171339b2eb (diff)
downloadlinux-f4a6c7a454a6e71c5ccf25af82694213a9784013.tar.gz
linux-f4a6c7a454a6e71c5ccf25af82694213a9784013.tar.bz2
linux-f4a6c7a454a6e71c5ccf25af82694213a9784013.zip
drm/i915/dsi: filter invalid backlight and CABC ports
Avoid using ports that aren't initialized in case the VBT backlight or CABC ports have invalid values. This fixes a NULL pointer dereference of intel_dsi->dsi_hosts[port] in such cases. Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/b0f4f087866257d280eb97d6bcfcefd109cc5fa2.1660664162.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/vlv_dsi.c')
-rw-r--r--drivers/gpu/drm/i915/display/vlv_dsi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
index b9b1fed99874..35136d26e517 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
@@ -1933,7 +1933,14 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
else
intel_dsi->ports = BIT(port);
+ if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
+ intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
+
intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;
+
+ if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
+ intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
+
intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
/* Create a DSI host (and a device) for each port. */