armbian_build/patch/kernel/archive/sunxi-6.12/patches.armbian/drv-drm-atomic-helper-null-pointer-fix.patch
Ryan L b31358752c
Some checks are pending
Forked Helper / 📢 Run repository dispatch on fork (push) Waiting to run
Announce PR merge to Discord / announcepush (push) Waiting to run
Scorecards Security Scan / Scorecards analysis (push) Waiting to run
Backport upstream kernel fixes for sun4i-drm and drm_atomic_helper_connector_hdmi_check()
Firstly, the upstream patch for sun4i-drm ensures the HDMI output is initialized successfully.
Secondly, patching drm_atomic_helper_connector_hdmi_check() avoids a null pointer dereference at shutdown or reboot
2025-07-02 12:38:14 +02:00

36 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ryzer58 <ryestar101@gmail.com>
Date: Mon, 23 Jun 2025 18:19:15 +0100
Subject: Backport null pointer check to drm HDMI atomic helper function
Backport fix from upstream kernel to address null pointer dereference in drm_atomic_helper_connector_hdmi_check().
If these checks are not in place, then drm_default_rgb_quant_range(), called by drm_atomic_helper_connector_hdmi_check()
would dereference the NULL pointer to_match in drm_match_cea_mode().
Signed-off-by: Ryzer58 <ryestar101@gmail.com>
---
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 936a8f95d80f..15661712d722 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -500,10 +500,13 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector,
drm_atomic_get_new_connector_state(state, connector);
const struct drm_display_mode *mode =
connector_state_get_mode(new_conn_state);
int ret;
+ if (!new_conn_state->crtc || !new_conn_state->best_encoder)
+ return 0;
+
new_conn_state->hdmi.is_limited_range = hdmi_is_limited_range(connector, new_conn_state);
ret = hdmi_compute_config(connector, new_conn_state, mode);
if (ret)
return ret;
--
Created with Armbian build tools https://github.com/armbian/build