drm/amd/display: Return the correct HDCP error code
authorjsg <jsg@openbsd.org>
Thu, 4 Apr 2024 07:27:46 +0000 (07:27 +0000)
committerjsg <jsg@openbsd.org>
Thu, 4 Apr 2024 07:27:46 +0000 (07:27 +0000)
From Rodrigo Siqueira
c7c855fd3d5af01496aaa8be93a1e9811166cf11 in linux-6.6.y/6.6.24
e64b3f55e458ce7e2087a0051f47edabf74545e7 in mainline linux

sys/dev/pci/drm/amd/display/modules/hdcp/hdcp_psp.c

index ee67a35..ff930a7 100644 (file)
@@ -513,6 +513,9 @@ enum mod_hdcp_status mod_hdcp_hdcp2_create_session(struct mod_hdcp *hdcp)
        hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.context.mem_context.shared_buf;
        memset(hdcp_cmd, 0, sizeof(struct ta_hdcp_shared_memory));
 
+       if (!display)
+               return MOD_HDCP_STATUS_DISPLAY_NOT_FOUND;
+
        hdcp_cmd->in_msg.hdcp2_create_session_v2.display_handle = display->index;
 
        if (hdcp->connection.link.adjust.hdcp2.force_type == MOD_HDCP_FORCE_TYPE_0)