* [bug report] drm/amd/display: Cleanup uses of the analog flag
@ 2025-11-21 13:35 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-11-21 13:35 UTC (permalink / raw)
To: Timur Kristóf; +Cc: amd-gfx, dri-devel, SHANMUGAM, SRINIVASAN
Hello Timur Kristóf,
This is a semi-automatic email about new static checker warnings.
Commit d46e422f65ae ("drm/amd/display: Cleanup uses of the analog
flag") from Nov 13, 2025, leads to the following Smatch complaint:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8858 amdgpu_dm_connector_get_modes()
warn: variable dereferenced before check 'amdgpu_dm_connector->dc_link' (see line 8846)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
8845 &amdgpu_dm_connector->dc_link->verified_link_cap;
8846 const struct dc *dc = amdgpu_dm_connector->dc_link->dc;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dereference
8847
8848 encoder = amdgpu_dm_connector_to_encoder(connector);
8849
8850 if (!drm_edid) {
8851 amdgpu_dm_connector->num_modes =
8852 drm_add_modes_noedid(connector, 640, 480);
8853 if (dc->link_srv->dp_get_encoding_format(verified_link_cap) == DP_128b_132b_ENCODING)
8854 amdgpu_dm_connector->num_modes +=
8855 drm_add_modes_noedid(connector, 1920, 1080);
8856
8857 if (amdgpu_dm_connector->dc_sink &&
8858 amdgpu_dm_connector->dc_link &&
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Checked too late. Presumably this NULL check could be removed?
8859 amdgpu_dm_connector->dc_sink->edid_caps.analog &&
8860 dc_connector_supports_analog(amdgpu_dm_connector->dc_link->link_id.id)) {
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-21 13:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 13:35 [bug report] drm/amd/display: Cleanup uses of the analog flag Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox