From: Inki Dae <inki.dae@samsung.com>
To: 'Sachin Kamat' <sachin.kamat@linaro.org>,
dri-devel@lists.freedesktop.org
Cc: 'Patch Tracking' <patches@linaro.org>
Subject: RE: [PATCH v2 1/1] drm/exynos: Fix freeing issues in exynos_drm_drv.c
Date: Tue, 21 Jan 2014 13:41:09 +0900 [thread overview]
Message-ID: <03ef01cf1663$01665210$0432f630$%dae@samsung.com> (raw)
In-Reply-To: <CAK9yfHw+2XQby_LwqJBa=js54=sh5JkYcM_qZxGHS-5wc=rQUA@mail.gmail.com>
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Tuesday, January 21, 2014 12:16 PM
> To: dri-devel@lists.freedesktop.org
> Cc: Inki Dae; Sachin Kamat; Patch Tracking
> Subject: Re: [PATCH v2 1/1] drm/exynos: Fix freeing issues in
> exynos_drm_drv.c
>
> Hi Inki,
>
> Does this patch look good now?
Sorry for being late.
Applied.
Thanks,
Inki Dae
>
> On 16 January 2014 11:31, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> > Fixes the following errors:
> > drivers/gpu/drm/exynos/exynos_drm_drv.c:182 exynos_drm_open()
> > error: double free of 'file_priv'
> > drivers/gpu/drm/exynos/exynos_drm_drv.c:188 exynos_drm_open()
> > error: dereferencing freed memory 'file_priv'
> >
> > Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> > ---
> > drivers/gpu/drm/exynos/exynos_drm_drv.c | 14 ++++++++------
> > 1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> > index 9d096a0..215131a 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> > @@ -171,22 +171,24 @@ static int exynos_drm_open(struct drm_device *dev,
> struct drm_file *file)
> > file->driver_priv = file_priv;
> >
> > ret = exynos_drm_subdrv_open(dev, file);
> > - if (ret) {
> > - kfree(file_priv);
> > - file->driver_priv = NULL;
> > - }
> > + if (ret)
> > + goto out;
> >
> > anon_filp = anon_inode_getfile("exynos_gem",
&exynos_drm_gem_fops,
> > NULL, 0);
> > if (IS_ERR(anon_filp)) {
> > - kfree(file_priv);
> > - return PTR_ERR(anon_filp);
> > + ret = PTR_ERR(anon_filp);
> > + goto out;
> > }
> >
> > anon_filp->f_mode = FMODE_READ | FMODE_WRITE;
> > file_priv->anon_filp = anon_filp;
> >
> > return ret;
> > +out:
> > + kfree(file_priv);
> > + file->driver_priv = NULL;
> > + return ret;
> > }
> >
> > static void exynos_drm_preclose(struct drm_device *dev,
> > --
> > 1.7.9.5
> >
>
>
>
> --
> With warm regards,
> Sachin
prev parent reply other threads:[~2014-01-21 4:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 6:01 [PATCH v2 1/1] drm/exynos: Fix freeing issues in exynos_drm_drv.c Sachin Kamat
2014-01-21 3:15 ` Sachin Kamat
2014-01-21 4:41 ` Inki Dae [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='03ef01cf1663$01665210$0432f630$%dae@samsung.com' \
--to=inki.dae@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.org \
/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 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.