linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: daniel@caiaq.de (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] jffs2: fix memory leak if the sector was successfully erased
Date: Mon, 22 Feb 2010 17:35:43 +0100	[thread overview]
Message-ID: <20100222163543.GL28972@buzzloop.caiaq.de> (raw)
In-Reply-To: <a9e22dff1002220826p63209a33n27e84ea10e191a19@mail.gmail.com>

On Mon, Feb 22, 2010 at 06:26:22PM +0200, Ni at m wrote:
> Memory allocated for erase instruction is not freed if the sector was
> successfully erased.
> 
> Signed-off-by: Dmytro Milinevskyy <niam.niam@gmail.com>

Can you forward that to the right people please? Call
scripts/get_maintainer.pl to get a list of maintainers.

Daniel



> ---
>  fs/jffs2/erase.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
> index b47679b..c0a5604 100644
> --- a/fs/jffs2/erase.c
> +++ b/fs/jffs2/erase.c
> @@ -74,8 +74,10 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
>         ((struct erase_priv_struct *)instr->priv)->c = c;
> 
>         ret = c->mtd->erase(c->mtd, instr);
> -       if (!ret)
> +       if (!ret) {
> +        kfree(instr);
>                 return;
> +    }
> 
>         bad_offset = instr->fail_addr;
>         kfree(instr);
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2010-02-22 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 16:26 [PATCH] jffs2: fix memory leak if the sector was successfully erased Ni@m
2010-02-22 16:33 ` Russell King - ARM Linux
2010-02-22 16:35 ` Daniel Mack [this message]
2010-02-22 17:28   ` Michael Trimarchi
2010-02-22 17:40     ` niam

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=20100222163543.GL28972@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).