When the HDMI unbinds drm_connector_cleanup() and drm_encoder_cleanup()
are called. This also happens when the connector and the encoder are
destroyed. This double call triggers a NULL pointer exception.

The patch fixes this by removing the cleanup calls in the unbind
function.

Signed-off-by: Stefan Mavrodiev <ste...@olimex.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c 
b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index a7c4654445c7..68d4644ac2dc 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -685,8 +685,6 @@ static void sun4i_hdmi_unbind(struct device *dev, struct 
device *master,
        struct sun4i_hdmi *hdmi = dev_get_drvdata(dev);
 
        cec_unregister_adapter(hdmi->cec_adap);
-       drm_connector_cleanup(&hdmi->connector);
-       drm_encoder_cleanup(&hdmi->encoder);
        i2c_del_adapter(hdmi->i2c);
        i2c_put_adapter(hdmi->ddc_i2c);
        clk_disable_unprepare(hdmi->mod_clk);
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20191217124632.20820-1-stefan%40olimex.com.

Reply via email to