[bug report] drm/amd/display: Add DCN3.1 HDCP support

Dan Carpenter dan.carpenter at oracle.com
Fri Jun 25 11:09:04 UTC 2021


Hello Nicholas Kazlauskas,

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

The patch bf62221e9d0e: "drm/amd/display: Add DCN3.1 HDCP support" 
from May 19, 2021, leads to the following Smatch complaint:

    drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:474 update_config()
    error: we previously assumed 'aconnector->dc_sink' could be null (see line 463)

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c
   462	
   463		if (aconnector->dc_sink != NULL)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check for NULL

   464			link->mode = mod_hdcp_signal_type_to_operation_mode(aconnector->dc_sink->sink_signal);
   465	
   466		display->controller = CONTROLLER_ID_D0 + config->otg_inst;
   467		display->dig_fe = config->dig_fe;
   468		link->dig_be = config->dig_be;
   469		link->ddc_line = aconnector->dc_link->ddc_hw_inst + 1;
   470		display->stream_enc_idx = config->stream_enc_idx;
   471		link->link_enc_idx = config->link_enc_idx;
   472		link->phy_idx = config->phy_idx;
   473		link->hdcp_supported_informational = dc_link_is_hdcp14(aconnector->dc_link,
   474				aconnector->dc_sink->sink_signal) ? 1 : 0;
                                ^^^^^^^^^^^^^^^^^^^
Unchecked dereference.  Originally there were some #ifdefs here and
that maybe ensured that ->dc_sink was non-NULL?  I'm not sure.

   475		link->dp.rev = aconnector->dc_link->dpcd_caps.dpcd_rev.raw;
   476		link->dp.assr_enabled = config->assr_enabled;

regards,
dan carpenter


More information about the amd-gfx mailing list