[PATCH 5.4 071/191] drm/sun4i: hdmi: Remove duplicate cleanup calls

From: Greg Kroah-Hartman
Date: Tue Jan 07 2020 - 15:58:51 EST

From: Stefan Mavrodiev <stefan@xxxxxxxxxx>

commit 57177d214ee0816c4436c23d6c933ccb32c571f1 upstream.

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

Cc: <stable@xxxxxxxxxxxxxxx>
Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support")
Signed-off-by: Stefan Mavrodiev <stefan@xxxxxxxxxx>
Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>
Link: https://patchwork.freedesktop.org/patch/msgid/20191217124632.20820-1-stefan@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 2 --
1 file changed, 2 deletions(-)

--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -683,8 +683,6 @@ static void sun4i_hdmi_unbind(struct dev
struct sun4i_hdmi *hdmi = dev_get_drvdata(dev);

- drm_connector_cleanup(&hdmi->connector);
- drm_encoder_cleanup(&hdmi->encoder);