Re: [PATCH v2 2/3] drm/bridge: ti-sn65dsi83: Fix error handling in sn65dsi83_reset_work()

From: Luca Ceresoli

Date: Thu Jul 16 2026 - 11:57:38 EST


On Wed, 15 Jul 2026 15:10:32 +0200, Esben Haabendal <esben@xxxxxxxxxx> wrote:

Hi Esben,

+Cc Hervé

>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index b4b220eee790..7e73035d7798 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -419,11 +419,12 @@ static void sn65dsi83_reset_work(struct work_struct *ws)
> ret = sn65dsi83_reset_pipe(ctx);
> if (ret) {
> dev_err(ctx->dev, "reset pipe failed %pe\n", ERR_PTR(ret));
> - return;
> + goto err_exit;
> }

This looked like a nasty bug! But it is not, out of pure luck. As sashiko
noticed:

| sashiko-bot@xxxxxxxxxx <sashiko-bot@xxxxxxxxxx>:
|
| [Severity: High]
| This isn't a bug introduced by this patch, but is this error handling block
| actually dead code?
|
| Looking at sn65dsi83_reset_pipe(), it appears to unconditionally return 0,
| even if drm_bridge_helper_reset_crtc() returns an error like -EINVAL or
| -ENOMEM:

So perhaps we should just remove the dead code, and also make
sn65dsi83_reset_pipe() return void.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com