Hello Aurabindo Pillai,

Commit 992694ad2858 ("drm/amd/display: Enable DCN6 sources
compilation") from Jul 21, 2026, leads to the following Smatch
complaint:

    drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dce110/dce110_hwseq.c:3500 
dce110_enable_tmds_link_output()
    warn: variable dereferenced before check 'link->link_enc' (see line 3490)

drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dce110/dce110_hwseq.c
  3489          (void)link_res;
  3490          link->link_enc->funcs->enable_tmds_output(
                ^^^^^^^^^^^^^^^^
The exiting code dereferences link->link_enc

  3491                          link->link_enc,
  3492                          clock_source,
  3493                          color_depth,
  3494                          signal,
  3495                          pixel_clock);
  3496          link->phy_state.symclk_state = SYMCLK_ON_TX_ON;
  3497  
  3498          // For dongle Type 2 with no I2C support on board, setup sw 
mode of Ri/Pj check with proper aux instance
  3499          if (link->force_to_use_aux) {
  3500                  if (link->link_enc && 
link->link_enc->funcs->setup_ri_pj_check_in_sw_or_hw_mode)
                            ^^^^^^^^^^^^^^

  3501                          
link->link_enc->funcs->setup_ri_pj_check_in_sw_or_hw_mode(link->link_enc,
  3502                                  link->aux_hw_inst, true);
  3503          } else
  3504                  // For HDMI setup hw mode of Ri/Pj check with proper 
ddc pin instance
  3505                  if (link->link_enc && 
link->link_enc->funcs->setup_ri_pj_check_in_sw_or_hw_mode)
                            ^^^^^^^^^^^^^^
So these checks don't make sense.

  3506                          
link->link_enc->funcs->setup_ri_pj_check_in_sw_or_hw_mode(link->link_enc,
  3507                                  link->ddc_hw_inst, false);
  3508  }


This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

Reply via email to