The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure
@ 2026-07-17  9:08 Johan Hovold
  2026-07-17 12:22 ` Laurent Pinchart
  2026-07-17 13:39 ` Luca Ceresoli
  0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2026-07-17  9:08 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart
  Cc: Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, Johan Hovold, stable

Make sure to drop the i2c adapter device and module references before
returning when detecting a malformed devicetree during probe.

Fixes: 80e2f97968b5 ("drm: bridge: dw-hdmi: Switch to regmap for register access")
Cc: stable@vger.kernel.org	# 4.12
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 17d5caedb32e..9eb6cf8a321f 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -3389,7 +3389,8 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
 			break;
 		default:
 			dev_err(dev, "reg-io-width must be 1 or 4\n");
-			return ERR_PTR(-EINVAL);
+			ret = -EINVAL;
+			goto err_res;
 		}
 
 		iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure
  2026-07-17  9:08 [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure Johan Hovold
@ 2026-07-17 12:22 ` Laurent Pinchart
  2026-07-17 13:39 ` Luca Ceresoli
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2026-07-17 12:22 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Jonas Karlman,
	Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel, stable

On Fri, Jul 17, 2026 at 11:08:19AM +0200, Johan Hovold wrote:
> Make sure to drop the i2c adapter device and module references before
> returning when detecting a malformed devicetree during probe.
> 
> Fixes: 80e2f97968b5 ("drm: bridge: dw-hdmi: Switch to regmap for register access")
> Cc: stable@vger.kernel.org	# 4.12
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 17d5caedb32e..9eb6cf8a321f 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -3389,7 +3389,8 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>  			break;
>  		default:
>  			dev_err(dev, "reg-io-width must be 1 or 4\n");
> -			return ERR_PTR(-EINVAL);
> +			ret = -EINVAL;
> +			goto err_res;
>  		}
>  
>  		iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure
  2026-07-17  9:08 [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure Johan Hovold
  2026-07-17 12:22 ` Laurent Pinchart
@ 2026-07-17 13:39 ` Luca Ceresoli
  1 sibling, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2026-07-17 13:39 UTC (permalink / raw)
  To: Johan Hovold, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart
  Cc: Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, stable

On Fri Jul 17, 2026 at 11:08 AM CEST, Johan Hovold wrote:
> Make sure to drop the i2c adapter device and module references before
> returning when detecting a malformed devicetree during probe.
>
> Fixes: 80e2f97968b5 ("drm: bridge: dw-hdmi: Switch to regmap for register access")
> Cc: stable@vger.kernel.org	# 4.12
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-17 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  9:08 [PATCH] drm/bridge: dw-hdmi: fix i2c adapter leak on probe failure Johan Hovold
2026-07-17 12:22 ` Laurent Pinchart
2026-07-17 13:39 ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox