All of lore.kernel.org
 help / color / mirror / Atom feed
From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Cc: Navid Emamdoost <emamd001@umn.edu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add
Date: Tue, 10 Dec 2019 20:33:50 -0600	[thread overview]
Message-ID: <CAEkB2ETfnejEiOeOWU1LdSW+SoovdqXOeJX+C=HK9=jMZDP0Ag@mail.gmail.com> (raw)
In-Reply-To: <CAEkB2ESR+GictT00W95pADAeakAuLrTECqUxEt=b7TG2x=FgVw@mail.gmail.com>

ping ...

On Thu, Nov 21, 2019 at 12:17 PM Navid Emamdoost
<navid.emamdoost@gmail.com> wrote:
>
> On Tue, Sep 24, 2019 at 11:38 PM Navid Emamdoost
> <navid.emamdoost@gmail.com> wrote:
> >
> > In vmw_cmdbuf_res_add if drm_ht_insert_item fails the allocated memory
> > for cres should be released.
> >
> > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
>
> Would you please review this patch?
>
> Thanks,
>
> > ---
> >  drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > index 4ac55fc2bf97..44d858ce4ce7 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > @@ -209,8 +209,10 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man,
> >
> >         cres->hash.key = user_key | (res_type << 24);
> >         ret = drm_ht_insert_item(&man->resources, &cres->hash);
> > -       if (unlikely(ret != 0))
> > +       if (unlikely(ret != 0)) {
> > +               kfree(cres);
> >                 goto out_invalid_key;
> > +       }
> >
> >         cres->state = VMW_CMDBUF_RES_ADD;
> >         cres->res = vmw_resource_reference(res);
> > --
> > 2.17.1
> >
>
>
> --
> Navid.



-- 
Navid.

WARNING: multiple messages have this Message-ID (diff)
From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: VMware Graphics <linux-graphics-maintainer@vmware.com>,
	 Thomas Hellstrom <thellstrom@vmware.com>,
	David Airlie <airlied@linux.ie>,  Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Cc: Navid Emamdoost <emamd001@umn.edu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add
Date: Tue, 10 Dec 2019 20:33:50 -0600	[thread overview]
Message-ID: <CAEkB2ETfnejEiOeOWU1LdSW+SoovdqXOeJX+C=HK9=jMZDP0Ag@mail.gmail.com> (raw)
In-Reply-To: <CAEkB2ESR+GictT00W95pADAeakAuLrTECqUxEt=b7TG2x=FgVw@mail.gmail.com>

ping ...

On Thu, Nov 21, 2019 at 12:17 PM Navid Emamdoost
<navid.emamdoost@gmail.com> wrote:
>
> On Tue, Sep 24, 2019 at 11:38 PM Navid Emamdoost
> <navid.emamdoost@gmail.com> wrote:
> >
> > In vmw_cmdbuf_res_add if drm_ht_insert_item fails the allocated memory
> > for cres should be released.
> >
> > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
>
> Would you please review this patch?
>
> Thanks,
>
> > ---
> >  drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > index 4ac55fc2bf97..44d858ce4ce7 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
> > @@ -209,8 +209,10 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man,
> >
> >         cres->hash.key = user_key | (res_type << 24);
> >         ret = drm_ht_insert_item(&man->resources, &cres->hash);
> > -       if (unlikely(ret != 0))
> > +       if (unlikely(ret != 0)) {
> > +               kfree(cres);
> >                 goto out_invalid_key;
> > +       }
> >
> >         cres->state = VMW_CMDBUF_RES_ADD;
> >         cres->res = vmw_resource_reference(res);
> > --
> > 2.17.1
> >
>
>
> --
> Navid.



-- 
Navid.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-12-11  2:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25  4:37 [PATCH] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add Navid Emamdoost
2019-09-25  4:37 ` Navid Emamdoost
2019-11-21 18:17 ` Navid Emamdoost
2019-11-21 18:17   ` Navid Emamdoost
2019-12-11  2:33   ` Navid Emamdoost [this message]
2019-12-11  2:33     ` Navid Emamdoost
2019-12-11 10:19 ` Thomas Hellstrom
2019-12-11 10:19   ` Thomas Hellstrom

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='CAEkB2ETfnejEiOeOWU1LdSW+SoovdqXOeJX+C=HK9=jMZDP0Ag@mail.gmail.com' \
    --to=navid.emamdoost@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emamd001@umn.edu \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thellstrom@vmware.com \
    /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.