AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: "Timur Kristóf" <timur.kristof@gmail.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"SHANMUGAM, SRINIVASAN" <SRINIVASAN.SHANMUGAM@amd.com>
Subject: [bug report] drm/amd/display: Cleanup uses of the analog flag
Date: Fri, 21 Nov 2025 16:35:42 +0300	[thread overview]
Message-ID: <aSBqrjTkmpMhLJmF@stanley.mountain> (raw)

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

                 reply	other threads:[~2025-11-21 13:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSBqrjTkmpMhLJmF@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=SRINIVASAN.SHANMUGAM@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=timur.kristof@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox