diff options
author | Douglas Anderson <dianders@chromium.org> | 2016-03-07 17:00:50 -0500 |
---|---|---|
committer | Mark Yao <mark.yao@rock-chips.com> | 2016-03-28 02:48:31 -0400 |
commit | 948cf42700b15fc65ec4cc3ac52a8bbeb84b87ef (patch) | |
tree | c65784b0eebe5cd03d764392db01c6b28fc9bc6c | |
parent | 3ed6c64911f2335b271c21363b7834072fc03303 (diff) |
drm/rockchip: dw_hdmi: Call drm_encoder_cleanup() in error path
The drm_encoder_cleanup() was missing both from the error path of
dw_hdmi_rockchip_bind(). This caused a crash when slub_debug was
enabled and we ended up deferring probe of HDMI at boot.
This call isn't needed from unbind() because if dw_hdmi_bind() returns
no error then it takes over the job of freeing the encoder (in
dw_hdmi_unbind).
Signed-off-by: Douglas Anderson <dianders@chromium.org>
-rw-r--r-- | drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 3d3cf2f8891e..88776aba984e 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | |||
@@ -293,7 +293,16 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, | |||
293 | drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, | 293 | drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, |
294 | DRM_MODE_ENCODER_TMDS, NULL); | 294 | DRM_MODE_ENCODER_TMDS, NULL); |
295 | 295 | ||
296 | return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); | 296 | ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); |
297 | |||
298 | /* | ||
299 | * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), | ||
300 | * which would have called the encoder cleanup. Do it manually. | ||
301 | */ | ||
302 | if (ret) | ||
303 | drm_encoder_cleanup(encoder); | ||
304 | |||
305 | return ret; | ||
297 | } | 306 | } |
298 | 307 | ||
299 | static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, | 308 | static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, |