mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/pl111: Fix error handling in pl111_amba_probe
@ 2025-12-11 12:33 Miaoqian Lin
  2025-12-31 21:45 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2025-12-11 12:33 UTC (permalink / raw)
  To: Linus Walleij, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Tom Cooksey,
	Eric Anholt, dri-devel, linux-kernel
  Cc: linmq006, stable

Jump to the existing dev_put label when devm_request_irq() fails
so drm_dev_put() and of_reserved_mem_device_release() run
instead of returning early and leaking resources.

Found via static analysis and code review.

Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 56ff6a3fb483..d7dc83cf7b00 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -295,7 +295,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
 			       variant->name, priv);
 	if (ret != 0) {
 		dev_err(dev, "%s failed irq %d\n", __func__, ret);
-		return ret;
+		goto dev_put;
 	}
 
 	ret = pl111_modeset_init(drm);
-- 
2.25.1


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

* Re: [PATCH] drm/pl111: Fix error handling in pl111_amba_probe
  2025-12-11 12:33 [PATCH] drm/pl111: Fix error handling in pl111_amba_probe Miaoqian Lin
@ 2025-12-31 21:45 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2025-12-31 21:45 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Tom Cooksey, Eric Anholt, dri-devel,
	linux-kernel, stable

On Thu, Dec 11, 2025 at 1:34 PM Miaoqian Lin <linmq006@gmail.com> wrote:

> Jump to the existing dev_put label when devm_request_irq() fails
> so drm_dev_put() and of_reserved_mem_device_release() run
> instead of returning early and leaking resources.
>
> Found via static analysis and code review.
>
> Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Patch applied to drm-misc-fixes, thanks for fixing this
obvious bug!

Yours,
Linus Walleij

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

end of thread, other threads:[~2025-12-31 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-11 12:33 [PATCH] drm/pl111: Fix error handling in pl111_amba_probe Miaoqian Lin
2025-12-31 21:45 ` Linus Walleij

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

all inboxes | Powered by JetHome®