Skip to contentSkip to conversation

drm/pl111: Fix error handling in pl111_amba_probe

PATCH In review Miaoqian Lin 2 participants 2 messages Dec 11, 2025 – Dec 31, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/pl111: Fix error handling in pl111_amba_probe

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")
---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/pl111/pl111_drv.c +1 -1
index 56ff6a3fb483..d7dc83cf7b00 100644
@@ -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);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 9 lines · Miaoqian Lin

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")

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

Yours,
Linus Walleij