Devicetree
 help / color / mirror / Atom feed
From: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
To: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: Fix a filehandle leak
Date: Wed, 14 Jul 2010 17:31:38 -0500	[thread overview]
Message-ID: <E1OZAUM-0007wJ-A8@jdl.com> (raw)
In-Reply-To: <20100714061056.GE23242@yookeroo>

> From: Martin Ettl <ettl.martin-Mmb7MZpHnFY@public.gmane.org>
> 
> During a check of the current git head of the linux kernel with the
> static code analysis tool cppcheck
> (http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page)
> the tool discovered a resource leak in linux-2.6/scripts/dtc/fstree.c.
> 
> Please refer the attached patch, that fixes the issue.
> 
> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15363
> 
> Signed-off-by: Martin Ettl <ettl.martin-Mmb7MZpHnFY@public.gmane.org>
> Signed-off-by: Michal Marek <mmarek-AlSwsSmVLrQ@public.gmane.org>
> Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
> 
> ---
> 
> Jon, please apply.
> 
>  scripts/dtc/fstree.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
> index 766b269..8fe1bdf 100644
> --- a/scripts/dtc/fstree.c
> +++ b/scripts/dtc/fstree.c
> @@ -77,6 +77,7 @@ static struct node *read_fstree(const char *dirname)
>  		free(tmpnam);
>  	}
>  
> +	closedir(d);
>  	return tree;
>  }
>  
> -- 
> 1.7.1
> 
> -- 
> David Gibson			| I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _ot
> her_
> 				| _way_ _around_!
> http://www.ozlabs.org/~dgibson

Applied -p 3.

jdl

       reply	other threads:[~2010-07-14 22:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100714061056.GE23242@yookeroo>
2010-07-14 22:31 ` Jon Loeliger [this message]
     [not found]   ` <E1OZAUM-0007wJ-A8-CYoMK+44s/E@public.gmane.org>
2010-07-15  4:01     ` Fix a filehandle leak David Gibson
2010-07-15 12:09       ` Jon Loeliger

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=E1OZAUM-0007wJ-A8@jdl.com \
    --to=jdl-cyomk+44s/e@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox