Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757390AbbKFPZJ (ORCPT ); Fri, 6 Nov 2015 10:25:09 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:48033 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbbKFPZH (ORCPT ); Fri, 6 Nov 2015 10:25:07 -0500 Message-ID: <1446823499.4569.5.camel@pengutronix.de> Subject: Re: [PATCH v2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane From: Philipp Zabel To: Liu Ying Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, airlied@linux.ie Date: Fri, 06 Nov 2015 16:24:59 +0100 In-Reply-To: <1446820965-19028-1-git-send-email-Ying.Liu@freescale.com> References: <1446820965-19028-1-git-send-email-Ying.Liu@freescale.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1455 Lines: 41 Am Freitag, den 06.11.2015, 22:42 +0800 schrieb Liu Ying: > For primary plane initialization failure cases, ipu_plane_init() may return > a pointer encoded by ERR_PTR(). So, we should bailout instead of using that > pointer blindly. > > Signed-off-by: Liu Ying > --- > v1->v2: > * Trivial commit message fix. > * Rebase onto Phillip's patch[1]. > [1] http://www.spinics.net/lists/dri-devel/msg93700.html > > 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 872183a..35a77e5 100644 > --- a/drivers/gpu/drm/imx/ipuv3-crtc.c > +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c > @@ -361,6 +361,10 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc, > dp = IPU_DP_FLOW_SYNC_BG; > ipu_crtc->plane[0] = ipu_plane_init(drm, ipu, pdata->dma[0], dp, 0, > DRM_PLANE_TYPE_PRIMARY); > + if (IS_ERR(ipu_crtc->plane[0])) { > + ret = PTR_ERR(ipu_crtc->plane[0]); > + goto err_put_resources; > + } > > ret = imx_drm_add_crtc(drm, &ipu_crtc->base, &ipu_crtc->imx_crtc, > &ipu_crtc->plane[0]->base, &ipu_crtc_helper_funcs, Applied, thanks. regards Philipp -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/