dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Artem Dinaburg" <artem@trailofbits.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 6.6.y] drm/amd/display: Validate function returns
Date: Tue, 29 Sep 2026 03:25:14 +0000	[thread overview]
Message-ID: <20260929032515.0244C1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260929031602.87583-1-artem@trailofbits.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/amd/display: early return in dc_dmub_srv_cmd_run_list() drops diagnostics
--

commit a641a7a2bd113ef9410e77f8cb3dd3d38d42ca71
Author: Alex Hung <alex.hung@amd.com>

drm/amd/display: Validate function returns

This commit adds checks for function return values to fix Coverity issues.
It handles errors from dmub_srv_wait_for_idle, dc_get_edp_link_panel_inst,
hubbub1_program_pstate_watermarks, and link_detect_connection_type.

> diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> index 30a79dffbd37a..b3f02f451535a 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> @@ -144,7 +144,9 @@ bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int coun
>  		if (status == DMUB_STATUS_QUEUE_FULL) {
>  			/* Execute and wait for queue to become empty again. */
>  			dmub_srv_cmd_execute(dmub);
> -			dmub_srv_wait_for_idle(dmub, 100000);
> +			status = dmub_srv_wait_for_idle(dmub, 100000);
> +			if (status != DMUB_STATUS_OK)
> +				return false;
>  
>  			/* Requeue the command. */
>  			status = dmub_srv_cmd_queue(dmub, &cmd_list[i]);
>  		}

[Severity: Medium]
Does this new early return inadvertently bypass the diagnostic data collection?

Looking at dc_dmub_srv_cmd_run_list(), right after this block there is an
error handler for when the queue or wait fails:

		if (status != DMUB_STATUS_OK) {
			DC_ERROR("Error queueing DMUB command: status=%d\n", status);
			dc_dmub_srv_log_diagnostic_data(dc_dmub_srv);
			return false;
		}

By returning false directly when dmub_srv_wait_for_idle() fails, we skip
dc_dmub_srv_log_diagnostic_data() and the DC_ERROR logging. Could we
instead let it fall through or break here so that the existing error
handler can collect this diagnostic data?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260929031602.87583-1-artem@trailofbits.com?part=1

  reply	other threads:[~2026-09-29  3:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  3:16 [PATCH 6.6.y] drm/amd/display: Validate function returns Artem Dinaburg
2026-09-29  3:25 ` sashiko-bot [this message]
2026-09-29 18:50 ` Sasha Levin

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=20260929032515.0244C1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=artem@trailofbits.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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