All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] nouveau: free the memory in nouveau_gart_manager_del()
Date: Sun, 26 Jun 2011 22:19:44 +0000	[thread overview]
Message-ID: <4E07B080.2000109@bfs.de> (raw)
In-Reply-To: <20110625055324.GS14591@shale.localdomain>

great bug to make sure that mem is never freed :)

@julia,

can coccinelle find this type  ?
they will never cause an error just a memleack that never
will be notices before its to late.

re,
 wh


Am 25.06.2011 07:53, schrieb Dan Carpenter:
> In the original code the kfree() doesn't do anything because
> "mem->mm_node" has been set to NULL.  This was introduced in
> d2f96666c56a "drm/nouveau: create temp vmas for both src and dst of
> bo moves"
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
> index 765f0e5..ab79bf8 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_mem.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
> @@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man,
>  			 struct ttm_mem_reg *mem)
>  {
>  	nouveau_mem_node_cleanup(mem->mm_node);
> -	mem->mm_node = NULL;
>  	kfree(mem->mm_node);
> +	mem->mm_node = NULL;
>  }
>  
>  static int
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

  parent reply	other threads:[~2011-06-26 22:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-25  5:53 [patch] nouveau: free the memory in nouveau_gart_manager_del() Dan Carpenter
2011-06-25  5:53 ` Dan Carpenter
2011-06-25 11:59 ` Ben Skeggs
2011-06-25 12:01   ` Ben Skeggs
2011-06-26 22:19 ` walter harms [this message]
2011-06-27  4:59 ` Julia Lawall
2011-06-27  6:50 ` Dan Carpenter

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=4E07B080.2000109@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.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.