Skip to contentSkip to conversation

drm/vc4: Fix refcount leak in vc4_hvs_bind

PATCH New Miaoqian Lin 1 participant 1 message Dec 20, 2022

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

PATCH 1/1 drm/vc4: Fix refcount leak in vc4_hvs_bind

rpi_firmware_get() takes refcount, we should release it with rpi_firmware_put(), add missing rpi_firmware_put() in the error path.

Fixes 2a001ca00ad5 ("drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code")
---
 drivers/gpu/drm/vc4/vc4_hvs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vc4/vc4_hvs.c +1 -0
index c4453a5ae163..816844ea60b1 100644
@@ -809,6 +809,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
 		hvs->core_clk = devm_clk_get(&pdev->dev, NULL);
 		if (IS_ERR(hvs->core_clk)) {
 			dev_err(&pdev->dev, "Couldn't get core clock\n");
+			rpi_firmware_put(firmware);
 			return PTR_ERR(hvs->core_clk);
 		}
 
Signature · 1 line
2.25.1