From: Suraj Kandpal <suraj.kandpal@xxxxxxxxx> commit d34f4f058edf1235c103ca9c921dc54820d14d40 upstream. Add encoder check in intel_hdcp2_get_capability to avoid null pointer error. Signed-off-by: Suraj Kandpal <suraj.kandpal@xxxxxxxxx> Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@xxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20240722064451.3610512-3-suraj.kandpal@xxxxxxxxx Signed-off-by: Lucas De Marchi <lucas.demarchi@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -677,8 +677,15 @@ static int intel_dp_hdcp2_get_capability(struct intel_connector *connector, bool *capable) { - struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - struct drm_dp_aux *aux = &dig_port->dp.aux; + struct intel_digital_port *dig_port; + struct drm_dp_aux *aux; + + *capable = false; + if (!intel_attached_encoder(connector)) + return -EINVAL; + + dig_port = intel_attached_dig_port(connector); + aux = &dig_port->dp.aux; return _intel_dp_hdcp2_get_capability(aux, capable); } Patches currently in stable-queue which might be from lucas.demarchi@xxxxxxxxx are queue-6.11/drm-xe-add-mmio-read-before-ggtt-invalidate.patch queue-6.11/drm-i915-disable-fbc-due-to-wa_16023588340.patch queue-6.11/drm-i915-skip-programming-fia-link-enable-bits-for-mtl.patch queue-6.11/drm-i915-display-cache-adpative-sync-caps-to-use-it-later.patch queue-6.11/drm-i915-display-don-t-enable-decompression-on-xe2-with-tile4.patch queue-6.11/drm-xe-xe2-introduce-performance-changes.patch queue-6.11/drm-xe-define-stateless_compression_ctrl-as-mcr-register.patch queue-6.11/drm-i915-hdcp-add-encoder-check-in-hdcp2_get_capability.patch queue-6.11/drm-i915-hdcp-add-encoder-check-in-intel_hdcp_get_capability.patch queue-6.11/drm-xe-don-t-short-circuit-tdr-on-jobs-not-started.patch queue-6.11/drm-xe-write-all-slices-if-its-mcr-register.patch queue-6.11/drm-i915-move-rawclk-from-runtime-to-display-runtime-info.patch queue-6.11/drm-xe-display-drop-unused-rawclk_freq-and-runtime_info.patch queue-6.11/drm-xe-xe2hpg-add-wa_15016589081.patch queue-6.11/drm-i915-display-dp-compute-as-sdp-when-vrr-is-also-enabled.patch queue-6.11/drm-i915-pps-disable-dpls_gating-around-pps-sequence.patch queue-6.11/drm-i915-dp-clear-vsc-sdp-during-post-ddi-disable-routine.patch queue-6.11/drm-xe-xe2-add-performance-turning-changes.patch queue-6.11/drm-i915-psr-prevent-panel-replay-if-crc-calculation-is-enabled.patch queue-6.11/drm-xe-move-enable-host-l2-vram-post-mcr-init.patch queue-6.11/drm-xe-support-nomodeset-kernel-command-line-option.patch queue-6.11/drm-xe-xe2hpg-introduce-performance-tuning-changes-for-xe2_hpg.patch queue-6.11/drm-i915-display-wa-for-re-initialize-dispcnlunitt1-xosc-clock.patch