[bug report] drm/amd/display: more liberal vmin/vmax update for freesync

Dan Carpenter dan.carpenter at linaro.org
Wed Aug 6 11:44:13 UTC 2025


Hello Aurabindo Pillai,

This is a semi-automatic email about new static checker warnings.

Commit 6d31602a9f57 ("drm/amd/display: more liberal vmin/vmax update
for freesync") from Apr 16, 2025, leads to the following Smatch
complaint:

    drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:623 dm_vupdate_high_irq()
    warn: variable dereferenced before check 'acrtc->dm_irq_params.stream' (see line 615)

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
   614			if (vrr_active) {
   615				bool replay_en = acrtc->dm_irq_params.stream->link->replay_settings.replay_feature_enabled;
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   616				bool psr_en = acrtc->dm_irq_params.stream->link->psr_settings.psr_feature_enabled;
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
New dereferences

   617				bool fs_active_var_en = acrtc->dm_irq_params.freesync_config.state
   618					== VRR_STATE_ACTIVE_VARIABLE;
   619	
   620				amdgpu_dm_crtc_handle_vblank(acrtc);
   621	
   622				/* BTR processing for pre-DCE12 ASICs */
   623				if (acrtc->dm_irq_params.stream &&
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
But the existing code assumed it could be NULL.  Someone is wrong.

   624				    adev->family < AMDGPU_FAMILY_AI) {
   625					spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags);

regards,
dan carpenter


More information about the amd-gfx mailing list