public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/hdcp: Add NULL check for media_gt in intel_hdcp_gsc_check_status()
@ 2026-03-02 18:18 Gustavo Sousa
  2026-03-02 23:07 ` Lin, Shuicheng
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gustavo Sousa @ 2026-03-02 18:18 UTC (permalink / raw)
  To: intel-xe; +Cc: Gustavo Sousa

When media GT is disabled via configfs, there is no allocation for
media_gt, which is kept as NULL.  In such scenario,
intel_hdcp_gsc_check_status() results in a kernel pagefault error due to
&gt->uc.gsc being evaluated as an invalid memory address.

Fix that by introducing a NULL check on media_gt and bailing out early
if so.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
index 29c72aa4b0d2..1cac00c17d4c 100644
--- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
+++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
@@ -39,6 +39,12 @@ static bool intel_hdcp_gsc_check_status(struct drm_device *drm)
 	struct xe_gt *gt = tile->media_gt;
 	struct xe_gsc *gsc = &gt->uc.gsc;
 
+	if (!gt) {
+		drm_dbg_kms(&xe->drm,
+			    "not checking GSC status for HDCP2.x: media GT not present or disabled\n");
+		return false;
+	}
+
 	if (!gsc || !xe_uc_fw_is_available(&gsc->fw)) {
 		drm_dbg_kms(&xe->drm,
 			    "GSC Components not ready for HDCP2.x\n");

---
base-commit: 40e52ed6c66cef091579dd7fe49ccd2de135f5c5
change-id: 20260302-check-for-null-media_gt-in-intel_hdcp_gsc_check_status-071898b8a402

Best regards,
--  
Gustavo Sousa <gustavo.sousa@intel.com>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-24  8:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 18:18 [PATCH] drm/xe/hdcp: Add NULL check for media_gt in intel_hdcp_gsc_check_status() Gustavo Sousa
2026-03-02 23:07 ` Lin, Shuicheng
2026-03-03 13:56   ` Gustavo Sousa
2026-03-03 16:53     ` Lin, Shuicheng
2026-03-11 22:09       ` Gustavo Sousa
2026-03-24  8:03         ` Bhadane, Dnyaneshwar
2026-03-03  0:37 ` ✓ CI.KUnit: success for " Patchwork
2026-03-03  1:12 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-03  9:32 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox