drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 19 Mar 2024 09:24:42 +0000 (11:24 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 26 Mar 2024 13:03:38 +0000 (15:03 +0200)
If we have no VBT, or the VBT didn't declare the encoder
in question, we won't have the 'devdata' for the encoder.
Instead of oopsing just bail early.

We won't be able to tell whether the port is DP++ or not,
but so be it.

Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240319092443.15769-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c

index c7841b3eede85c98f67fdfeeaea33597efc02401..c13a98431a7b1ae5899a1490fc22bb7f2bfeba24 100644 (file)
@@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
 {
        const struct child_device_config *child = &devdata->child;
 
+       if (!devdata)
+               return false;
+
        if (!intel_bios_encoder_supports_dp(devdata) ||
            !intel_bios_encoder_supports_hdmi(devdata))
                return false;