From: Douglas Anderson <dianders@chromium.org>
To: Mark Yao <mark.yao@rock-chips.com>,
David Airlie <airlied@linux.ie>,
linux@arm.linux.org.uk, Heiko Stuebner <heiko@sntech.de>
Cc: Daniel Kurtz <djkurtz@chromium.org>,
linux-rockchip@lists.infradead.org, john@keeping.me.uk,
Douglas Anderson <dianders@chromium.org>,
p.zabel@pengutronix.de, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/5] drm/imx: dw_hdmi: Call drm_encoder_cleanup() in error path
Date: Mon, 7 Mar 2016 14:00:51 -0800 [thread overview]
Message-ID: <1457388054-23077-2-git-send-email-dianders@chromium.org> (raw)
In-Reply-To: <1457388054-23077-1-git-send-email-dianders@chromium.org>
The drm_encoder_cleanup() was missing both from the error path of
dw_hdmi_imx_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>
---
Changes in v2:
- IMX patch new in v2
drivers/gpu/drm/imx/dw_hdmi-imx.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index 2a95d10e9d92..c69c3142819c 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -245,7 +245,16 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master,
drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
- return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data);
+ ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data);
+
+ /*
+ * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(),
+ * which would have called the encoder cleanup. Do it manually.
+ */
+ if (ret)
+ drm_encoder_cleanup(encoder);
+
+ return ret;
}
static void dw_hdmi_imx_unbind(struct device *dev, struct device *master,
--
2.7.0.rc3.207.g0ac5344
next prev parent reply other threads:[~2016-03-07 22:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 22:00 [PATCH v2 1/5] drm/rockchip: " Douglas Anderson
2016-03-07 22:00 ` Douglas Anderson [this message]
2016-03-28 15:14 ` [PATCH v2 2/5] drm/imx: " Doug Anderson
2016-03-30 13:35 ` Philipp Zabel
2016-03-07 22:00 ` [PATCH v2 3/5] drm/rockchip: vop: Fix vop crtc cleanup Douglas Anderson
2016-03-07 22:00 ` [PATCH v2 4/5] drm/rockchip: dw_hdmi: Don't call platform_set_drvdata() Douglas Anderson
2016-03-07 22:00 ` [PATCH v2 5/5] drm/imx: " Douglas Anderson
2016-03-28 6:45 ` [PATCH v2 1/5] drm/rockchip: dw_hdmi: Call drm_encoder_cleanup() in error path Mark yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457388054-23077-2-git-send-email-dianders@chromium.org \
--to=dianders@chromium.org \
--cc=airlied@linux.ie \
--cc=djkurtz@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=john@keeping.me.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.yao@rock-chips.com \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®