From: Liu Ying <Ying.Liu@freescale.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<airlied@linux.ie>
Subject: Re: [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane
Date: Fri, 6 Nov 2015 18:25:39 +0800 [thread overview]
Message-ID: <20151106102538.GA2036@shlinux2> (raw)
In-Reply-To: <1446804354.4569.2.camel@pengutronix.de>
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
>
prev parent reply other threads:[~2015-11-06 10:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` [PATCH 2/2] drm/imx: Remove the primary plane created by create_primary_plane() Liu Ying
2015-11-06 10:05 ` Philipp Zabel
2015-11-06 10:38 ` Liu Ying
2015-11-16 16:00 ` Daniel Vetter
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:25 ` Liu Ying [this message]
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=20151106102538.GA2036@shlinux2 \
--to=ying.liu@freescale.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--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