# \[PATCH\] drm/pl111: Fix error handling in pl111\_amba\_probe

- Subsystems: DRM DRIVER FOR ARM PL111 CLCD, DRM DRIVERS, DRM DRIVERS AND MISC GPU PATCHES, THE REST
- Maintainers: Linus Walleij, David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Linus Torvalds
- Status: LANDED (0ddd3bb4b14c · 2025-12-31 21:42)
- Landed in mainline as 0ddd3bb4b14c on 2025-12-31.
- List: stable
- 2 messages, 2 authors
- Page: https://ratatoskr.run/stable/2025/12/3330708/t

## \[PATCH\] drm/pl111: Fix error handling in pl111\_amba\_probe

- From: Miaoqian Lin \<hidden\>
- Date: 2025-12-11 12:33:58 
- Message: https://ratatoskr.run/stable/2025/12/3330708.md

```text
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: <redacted>
Signed-off-by: Miaoqian Lin <redacted>
---
 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

```

## Re: \[PATCH\] drm/pl111: Fix error handling in pl111\_amba\_probe

- From: Linus Walleij \<linusw@kernel.org\>
- Date: 2025-12-31 21:45:51 
- Message: https://ratatoskr.run/stable/2025/12/3349946.md

```text
On Thu, Dec 11, 2025 at 1:34 PM Miaoqian Lin [ref] 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: <redacted>
> Signed-off-by: Miaoqian Lin <redacted>

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

Yours,
Linus Walleij
```
