All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>
Cc: linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v8 2/5] drm/scdc-helper: Add scdc_status debugfs entry
Date: Wed, 22 Jul 2026 09:27:25 +0000	[thread overview]
Message-ID: <20260722092725.923661F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260722-scdc-link-health-v8-2-cd1dacbb85d9@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The function `scdc_status_show` leaks `connector->dev->mode_config.mutex` on the disconnected error path.
--

--- Patch [2]: [PATCH v8 2/5] drm/scdc-helper: Add scdc_status debugfs entry ---
commit 524b3064a7221dcef8708b2269e2ccaa3ede6629
Author: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

drm/scdc-helper: Add scdc_status debugfs entry

This commit adds a debugfs entry under the connector to expose SCDC status
information. It introduces drm_scdc_read_state to read and parse the SCDC
registers and a debugfs init function for connectors to use.

> diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c
> index 8403f2390ab6a..97256b272329a 100644
> --- a/drivers/gpu/drm/display/drm_scdc_helper.c
> +++ b/drivers/gpu/drm/display/drm_scdc_helper.c
[ ... ]
> @@ -276,3 +278,187 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector,
[ ... ]
> +static int scdc_status_show(struct seq_file *m, void *data)
> +{
> +	struct drm_connector *connector = m->private;
> +	struct drm_scdc *scdc = &connector->display_info.hdmi.scdc;
> +	struct drm_scdc_state *st;
> +	int i, ret;
> +
> +	drm_connector_get(connector);
> +
> +	ret = mutex_lock_interruptible(&connector->dev->mode_config.mutex);
> +	if (ret)
> +		goto err_conn_put;
> +
> +	if (connector->status != connector_status_connected) {
> +		ret = -ENODEV;
> +		goto err_conn_put;

[Severity: High]
Does this error path leak connector->dev->mode_config.mutex?

The mutex is successfully acquired just above this check. If the connector
is not connected, jumping directly to err_conn_put bypasses the err_unlock
label where the mutex is supposed to be released.

> +	}
> +
> +	if (scdc->supported) {
[ ... ]
> +
> +err_free_state:
> +	kfree(st);
> +err_unlock:
> +	mutex_unlock(&connector->dev->mode_config.mutex);
> +err_conn_put:
> +	drm_connector_put(connector);
> +
> +	return ret;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260722-scdc-link-health-v8-0-cd1dacbb85d9@collabora.com?part=2

  reply	other threads:[~2026-07-22  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  9:11 [PATCH v8 0/5] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 1/5] drm/scdc-helper: Don't use ssize_t return type for scdc_read/write Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 2/5] drm/scdc-helper: Add scdc_status debugfs entry Nicolas Frattaroli
2026-07-22  9:27   ` sashiko-bot [this message]
2026-07-22  9:36     ` Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 3/5] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-07-22  9:38   ` sashiko-bot
2026-07-22  9:11 ` [PATCH v8 4/5] drm/debugfs: Move HDMI debugfs registration to state helper Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 5/5] drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI Nicolas Frattaroli
2026-07-22  9:50   ` sashiko-bot

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=20260722092725.923661F00AC4@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=nicolas.frattaroli@collabora.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.