]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Return the correct HDCP error code
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Wed, 14 Feb 2024 20:29:51 +0000 (13:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:32 +0000 (15:11 +0200)
[ Upstream commit e64b3f55e458ce7e2087a0051f47edabf74545e7 ]

[WHY & HOW]
If the display is null when creating an HDCP session, return a proper
error code.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c

index ee67a35c2a8eddab3d27f4403054032aa93c187b..ff930a71e496a94399fe5c05f46cb187f3e1d440 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)