Patch looks good to me. Reviewed-by: Tom Chung <[email protected]>
Thanks, Tom Chung On 3/15/2026 9:02 PM, Srinivasan Shanmugam wrote:
parse_edid_displayid_vrr() searches the EDID extension blocks for a DisplayID extension before parsing the dynamic video timing range. The code previously checked whether edid_ext was NULL after the search loop. However, edid_ext is assigned during each iteration of the loop, so it will never be NULL once the loop has executed. If no DisplayID extension is found, edid_ext ends up pointing to the last extension block, and the NULL check does not correctly detect the failure case. Instead, check whether the loop completed without finding a matching DisplayID block by testing "i == edid->extensions". This ensures the function exits early when no DisplayID extension is present and avoids parsing an unrelated EDID extension block. Also simplify the EDID validation check using "!edid || !edid->extensions". Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:13079 parse_edid_displayid_vrr() warn: variable dereferenced before check 'edid_ext' (see line 13075) Fixes: a638b837d0e6 ("drm/amd/display: Fix refresh rate range for some panel") Cc: Roman Li <[email protected]> Cc: Alex Hung <[email protected]> Cc: Jerry Zuo <[email protected]> Cc: Sun peng Li <[email protected]> Cc: Tom Chung <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Aurabindo Pillai <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5323843c718d..acdc4abbdddc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -13124,7 +13124,7 @@ static void parse_edid_displayid_vrr(struct drm_connector *connector, u16 min_vfreq; u16 max_vfreq;- if (edid == NULL || edid->extensions == 0)+ if (!edid || !edid->extensions) return;/* Find DisplayID extension */@@ -13134,7 +13134,7 @@ static void parse_edid_displayid_vrr(struct drm_connector *connector, break; }- if (edid_ext == NULL)+ if (i == edid->extensions) return;while (j < EDID_LENGTH) {
