Commit e075a781 authored by Maxime Ripard's avatar Maxime Ripard

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: 10ee275c ("drm/vc4: prepare for CEC support")
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210524131852.263883-1-maxime@cerno.tech
parent 8f8e19bd
...@@ -2152,7 +2152,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) ...@@ -2152,7 +2152,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
&hpd_gpio_flags); &hpd_gpio_flags);
if (vc4_hdmi->hpd_gpio < 0) { if (vc4_hdmi->hpd_gpio < 0) {
ret = vc4_hdmi->hpd_gpio; ret = vc4_hdmi->hpd_gpio;
goto err_unprepare_hsm; goto err_put_ddc;
} }
vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW; 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) ...@@ -2209,8 +2209,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
vc4_hdmi_connector_destroy(&vc4_hdmi->connector); vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
err_destroy_encoder: err_destroy_encoder:
drm_encoder_cleanup(encoder); drm_encoder_cleanup(encoder);
err_unprepare_hsm:
pm_runtime_disable(dev); pm_runtime_disable(dev);
err_put_ddc:
put_device(&vc4_hdmi->ddc->dev); put_device(&vc4_hdmi->ddc->dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment