Skip to content

Commit e075a78

Browse files
committed
drm/vc4: hdmi: Fix error path of hpd-gpios
If the of_get_named_gpio_flags call fails in vc4_hdmi_bind, we jump to the err_unprepare_hsm label. That label will then call pm_runtime_disable and put_device on the DDC device. We just retrieved the DDC device, so the latter is definitely justified. However at that point we still haven't called pm_runtime_enable, so the call to pm_runtime_disable is not supposed to be there. Fixes: 10ee275 ("drm/vc4: prepare for CEC support") Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8f8e19b commit e075a78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
21522152
&hpd_gpio_flags);
21532153
if (vc4_hdmi->hpd_gpio < 0) {
21542154
ret = vc4_hdmi->hpd_gpio;
2155-
goto err_unprepare_hsm;
2155+
goto err_put_ddc;
21562156
}
21572157

21582158
vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW;
@@ -2209,8 +2209,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22092209
vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
22102210
err_destroy_encoder:
22112211
drm_encoder_cleanup(encoder);
2212-
err_unprepare_hsm:
22132212
pm_runtime_disable(dev);
2213+
err_put_ddc:
22142214
put_device(&vc4_hdmi->ddc->dev);
22152215

22162216
return ret;

0 commit comments

Comments
 (0)