From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6D927391E51; Sat, 17 Oct 2026 16:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255869; cv=none; b=WzWJ9xLtB4QsWfKIkYlG7V/kkgYfBIahx3Zhz7SvtVEICQUJWuVmhYYeaVJ2gdyORIWidqojYEm1uuZjz+A4G9oOsXMui1cPdwpqFKgd2Rjmr182z8y9JqByrnfJguegxjByrc2HboNJe6gdnQtdGsKZZKQXpRs01VdrRIjtJK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255869; c=relaxed/simple; bh=W0e8QqzDPE6BeaTsFvf3sT22th/0B97wE45IVKkuNIE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rggGMZglvupeeMybScdW0QGrRMWjYNZgX/Q4qdxtWatg9f8vKky1AKohYyDe/faC9h2TMbzJyNhIiIWEUfElVMfKMVxh2j9lEIrlz4v+5pMjz64hyzFHJT+KYTmEasjdnRNjEmgOE/p/uUJoB+4VnU33dvNGZ0z526xWtrWT/kI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dZpuQ8ap; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dZpuQ8ap" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4EB11F000C4; Sat, 17 Oct 2026 16:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792255868; bh=HxK/IX0AiH6FfeVyGBR8s8QeosXnTJBzlJ7qTeNi3nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dZpuQ8ap7QRA8inDIarb9XHsh0bnGu7Jki0gvOOoxTlrQvEKXKnsyNHbog3z76Zhr GbyiBaC3E8fZ/ANV24GvDduVdojeSjp7n2QsPzKcYQZ+JFwj6qgGcOCla8EiXespl0 GLR4taJAHx4QG7YgZyZjLIMlhlF4qDogVwFUQgn4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Suraj Kandpal , Dnyaneshwar Bhadane , Artem Dinaburg , Sasha Levin Subject: [PATCH 6.6 0048/1674] drm/i915/hdcp: Add encoder check in intel_hdcp_get_capability Date: Sat, 17 Oct 2026 17:38:40 +0200 Message-ID: <20261017160432.372006925@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Suraj Kandpal [ Upstream commit 31b42af516afa1e184d1a9f9dd4096c54044269a ] Sometimes during hotplug scenario or suspend/resume scenario encoder is not always initialized when intel_hdcp_get_capability add a check to avoid kernel null pointer dereference. [ Backport to 6.6.y: this tree uses the older intel_hdcp_capable() helper name. Apply the same guard there; the code change is otherwise unchanged. ] Signed-off-by: Suraj Kandpal Reviewed-by: Dnyaneshwar Bhadane Link: https://patchwork.freedesktop.org/patch/msgid/20240722064451.3610512-2-suraj.kandpal@intel.com Assisted-by: LLM Signed-off-by: Artem Dinaburg Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/display/intel_hdcp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index f377c4484e185..f7987fb90bb1a 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -142,11 +142,16 @@ int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port, /* Is HDCP1.4 capable on Platform and Sink */ bool intel_hdcp_capable(struct intel_connector *connector) { - struct intel_digital_port *dig_port = intel_attached_dig_port(connector); + struct intel_digital_port *dig_port; const struct intel_hdcp_shim *shim = connector->hdcp.shim; bool capable = false; u8 bksv[5]; + if (!intel_attached_encoder(connector)) + return capable; + + dig_port = intel_attached_dig_port(connector); + if (!shim) return capable; -- 2.53.0