All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane
@ 2015-11-04 10:15 ` Liu Ying
  0 siblings, 0 replies; 16+ messages in thread
From: Liu Ying @ 2015-11-04 10:15 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, p.zabel, airlied

For primary plane initialization failure cases, ipu_plane_init() may return
a pointer encoded by ERR_PTR(). So, we should bailout instead of use that
pointer blindly.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
---
 drivers/gpu/drm/imx/ipuv3-crtc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 7bc8301..8d68697 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -370,6 +370,10 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc,
 	id = imx_drm_crtc_id(ipu_crtc->imx_crtc);
 	ipu_crtc->plane[0] = ipu_plane_init(ipu_crtc->base.dev, ipu,
 					    pdata->dma[0], dp, BIT(id), true);
+	if (IS_ERR(ipu_crtc->plane[0])) {
+		ret = PTR_ERR(ipu_crtc->plane[0]);
+		goto err_put_resources;
+	}
 	ret = ipu_plane_get_resources(ipu_crtc->plane[0]);
 	if (ret) {
 		dev_err(ipu_crtc->dev, "getting plane 0 resources failed with %d.\n",
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-11-17  2:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 10:15 [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane Liu Ying
2015-11-04 10:15 ` Liu Ying
2015-11-04 10:15 ` [PATCH 2/2] drm/imx: Remove the primary plane created by create_primary_plane() Liu Ying
2015-11-04 10:15   ` Liu Ying
2015-11-06 10:05   ` Philipp Zabel
2015-11-06 10:05     ` Philipp Zabel
2015-11-06 10:38     ` Liu Ying
2015-11-06 10:38       ` Liu Ying
2015-11-16 16:00   ` Daniel Vetter
2015-11-16 16:00     ` Daniel Vetter
2015-11-17  2:10     ` Liu Ying
2015-11-17  2:10       ` Liu Ying
2015-11-06 10:05 ` [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane Philipp Zabel
2015-11-06 10:05   ` Philipp Zabel
2015-11-06 10:25   ` Liu Ying
2015-11-06 10:25     ` Liu Ying

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.