From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 09/10] drm/bridge: ti-sn65dsi83: Remove redundant dev_err_probe()
Date: Thu, 23 Jul 2026 13:26:25 +0000 [thread overview]
Message-ID: <20260723132628.1B9B71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723131649.134127-10-panchuang@vivo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The background work `ctx->reset_work` is never explicitly canceled, which can lead to a Use-After-Free if it executes after `ctx` is freed.
--
--- Patch [9]: [PATCH 09/10] drm/bridge: ti-sn65dsi83: Remove redundant dev_err_probe() ---
commit ae3029f9f75aff0082e24f794cc2c0d8fb473908
Author: Pan Chuang <panchuang@vivo.com>
drm/bridge: ti-sn65dsi83: Remove redundant dev_err_probe()
Since commit 55b48e23f5c4, devm_request_threaded_irq() automatically logs
detailed error messages on failure. This patch removes the now-redundant
driver-specific dev_err_probe() call.
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -1040,7 +1040,7 @@ static int sn65dsi83_probe(struct i2c_client *client)
> ret = devm_request_threaded_irq(ctx->dev, ctx->irq, NULL, sn65dsi83_irq,
> IRQF_ONESHOT, dev_name(ctx->dev), ctx);
> if (ret)
> - return dev_err_probe(dev, ret, "failed to request irq\n");
> + return ret;
> }
>
> dev_set_drvdata(dev, ctx);
[Severity: High]
This is a pre-existing issue, but looking at the driver initialization and
teardown, is there a risk of a use-after-free with ctx->reset_work?
When the IRQ is successfully requested, the handler sn65dsi83_irq() becomes
active. If a hardware error triggers the IRQ handler, it calls
sn65dsi83_handle_errors() which schedules the reset work:
drivers/gpu/drm/bridge/ti-sn65dsi83.c:sn65dsi83_handle_errors() {
...
schedule_work(&ctx->reset_work);
...
}
If the probe fails later (for example, when sn65dsi83_host_attach() fails),
the err_remove_bridge path is taken:
drivers/gpu/drm/bridge/ti-sn65dsi83.c:sn65dsi83_probe() {
err_remove_bridge:
drm_bridge_remove(&ctx->bridge);
return ret;
}
Since there is no explicit cancellation of the work here, and devres will
subsequently free the ctx structure upon probe failure, could a scheduled
reset work execute and dereference the freed ctx pointer?
The same pattern appears to exist in the normal driver removal path:
drivers/gpu/drm/bridge/ti-sn65dsi83.c:sn65dsi83_remove() {
struct sn65dsi83 *ctx = i2c_get_clientdata(client);
drm_bridge_unplug(&ctx->bridge);
}
Could this also leave a dangling work item that outlives the device context
if the device is unbound via sysfs while the background work is pending?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723131649.134127-1-panchuang@vivo.com?part=9
next prev parent reply other threads:[~2026-07-23 13:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 13:16 [PATCH 00/10] drm/bridge: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-23 13:16 ` [PATCH 01/10] drm/bridge: analogix_dp: Remove redundant dev_err() Pan Chuang
2026-07-24 1:14 ` Damon Ding
2026-07-23 13:16 ` [PATCH 02/10] drm/bridge: cdns-mhdp8546: " Pan Chuang
2026-07-23 13:29 ` sashiko-bot
2026-07-23 13:16 ` [PATCH 03/10] drm/bridge: lt9611: " Pan Chuang
2026-07-23 13:27 ` sashiko-bot
2026-07-23 13:16 ` [PATCH 04/10] drm/bridge: samsung-dsim: " Pan Chuang
2026-07-23 13:16 ` [PATCH 05/10] drm/bridge: synopsys: dw-dp: Remove redundant dev_err_probe() Pan Chuang
2026-07-23 13:16 ` [PATCH 06/10] drm/bridge: tc358767: Remove redundant dev_err() Pan Chuang
2026-07-23 13:16 ` [PATCH 07/10] drm/bridge: it6505: " Pan Chuang
2026-07-23 13:16 ` [PATCH 08/10] drm/bridge/sii8620: Remove redundant dev_err_probe() Pan Chuang
2026-07-23 13:16 ` [PATCH 09/10] drm/bridge: ti-sn65dsi83: " Pan Chuang
2026-07-23 13:26 ` sashiko-bot [this message]
2026-07-23 13:16 ` [PATCH 10/10] drm/bridge: ti-sn65dsi86: " Pan Chuang
2026-07-23 14:30 ` [PATCH 00/10] drm/bridge: Remove redundant error messages on IRQ request failure Luca Ceresoli
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=20260723132628.1B9B71F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=panchuang@vivo.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.