From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E608E823A6; Mon, 8 Apr 2024 13:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582116; cv=none; b=eGwieRX1XkhKGZzNi9iN7MDICLSz6NdOPB00sxqGpXbj0DR8d/lwaCEhI7A776FJ7EKESGA9SNlDsOhEF6wI30BJutfh/6/8bAtnep+W+2Az7t5yGVdwFPf2lVxdIFVsuDt18Er1RhiTJZaHNE+JCE7BbEc9W0UN7YCzuwHvYFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582116; c=relaxed/simple; bh=hzHGzmbkVuQBWvrrF8ko5Tga8leAxFEWwMoDouiXx7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GC3RFOmgvP+Fwj++sFoLyRATbFW7/Xl515pOc9vN5dd0ZR6/Nrun+E71wOm0eMSaBT9QJ3yapvmJ+0/53V64sDVpgRln8n+9JcqDfr16Qb5xz3xUwPOmYJPoBZqIyJ9VnYC99FegUkoSeyhpSzr4743kO26vP6tMrHZQZ3xUnMw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=y+lZxzuw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="y+lZxzuw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D89AC433F1; Mon, 8 Apr 2024 13:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712582115; bh=hzHGzmbkVuQBWvrrF8ko5Tga8leAxFEWwMoDouiXx7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y+lZxzuwU0GKJ2e6Bm2VL3f01rfwipFYMxOixktedVGZwoSkwtYHHKsQ9Z1cdd4Gp 2yAEFmlXbMeoX+S0TBNj+7+FY9m1HpQhFLIg17wDy04lD3qcaUIQgJTW4tbFiU9V5Q GlmOV0/aWirnTkpaoOXbbyjcA7VKxXUo25fiRhM0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mario Limonciello , Alex Deucher , Alex Hung , Rodrigo Siqueira , Daniel Wheeler , Sasha Levin Subject: [PATCH 5.15 112/690] drm/amd/display: Return the correct HDCP error code Date: Mon, 8 Apr 2024 14:49:38 +0200 Message-ID: <20240408125403.592378736@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125359.506372836@linuxfoundation.org> References: <20240408125359.506372836@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rodrigo Siqueira [ Upstream commit e64b3f55e458ce7e2087a0051f47edabf74545e7 ] [WHY & HOW] If the display is null when creating an HDCP session, return a proper error code. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Alex Hung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c index be61975f14703..11939be2b46ab 100644 --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c @@ -509,6 +509,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) -- 2.43.0