Skip to contentSkip to conversation

drm/bridge: synopsys: dw-dp: Pass dp->irq instead of ret to ERR_PTR() on IRQ failure

PATCH In review Alper Ak 2 participants 2 messages Dec 26, 2025

Subsystems (4)
lore
Share & tools
lore

Alper Ak

author
#0 lore raw

PATCH 1/1 drm/bridge: synopsys: dw-dp: Pass dp->irq instead of ret to ERR_PTR() on IRQ failure

The error handling after platform_get_irq() incorrectly passes ret to ERR_PTR(), but ret still holds the value 0 from the previous successful devm_add_action_or_reset() call. This causes ERR_PTR(0) which returns NULL instead of a proper error pointer.

Pass dp->irq to ERR_PTR() since platform_get_irq() returns the negative error code directly in dp->irq on failure.

Fixes 86eecc3a9c2e ("drm/bridge: synopsys: Add DW DPTX Controller support library")
---
 drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-dp.c +1 -1
index 36382956bbe0..718397a29e80 100644
@@ -2079,7 +2079,7 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
 
 	dp->irq = platform_get_irq(pdev, 0);
 	if (dp->irq < 0)
-		return ERR_PTR(ret);
+		return ERR_PTR(dp->irq);
 
 	ret = devm_request_threaded_irq(dev, dp->irq, NULL, dw_dp_irq,
 					IRQF_ONESHOT, dev_name(dev), dp);
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hello Alper,

Quoted 10 lines · Alper Ak

The error handling after platform_get_irq() incorrectly passes ret to ERR_PTR(), but ret still holds the value 0 from the previous successful devm_add_action_or_reset() call. This causes ERR_PTR(0) which returns NULL instead of a proper error pointer.

Pass dp->irq to ERR_PTR() since platform_get_irq() returns the negative error code directly in dp->irq on failure.

Fixes 86eecc3a9c2e ("drm/bridge: synopsys: Add DW DPTX Controller support library")

Thanks

Quoted 19 lines

---
drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-dp.c +1 -1
index 36382956bbe0..718397a29e80 100644
@@ -2079,7 +2079,7 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
 
 	dp->irq = platform_get_irq(pdev, 0);
 	if (dp->irq < 0)
-		return ERR_PTR(ret);
+		return ERR_PTR(dp->irq);
 
 	ret = devm_request_threaded_irq(dev, dp->irq, NULL, dw_dp_irq,
 					IRQF_ONESHOT, dev_name(dev), dp);
Signature · 1 line
2.43.0