lkml.org 
[lkml]   [2015]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane
On Fri, Nov 06, 2015 at 11:05:54AM +0100, Philipp Zabel wrote:
> Hi Liu,
>
> Am Mittwoch, den 04.11.2015, 18:15 +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 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;
>
> That should be "goto err_remove_crtc;"

Ah, yes, you're right. I'll fix this.
BTW, there is nothing to free the ipu_plane allocated in ipu_plane_init() in
case something goes wrong after ipu_plane_init(). Of course, we may fix this
with another patch.

Thanks,
Liu Ying

>
> regards
> Philipp
>


\
 
 \ /
  Last update: 2015-11-06 11:41    [W:0.069 / U:1.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site