mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "David Woodhouse" <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	"Jochen Schäuble" <psionic@psionic.de>,
	"Jörn Engel" <joern@wohnheim.fh-wedel.de>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] mtd: fix memory leaks in phram_setup
Date: Sun, 14 May 2006 01:34:13 +0200	[thread overview]
Message-ID: <9a8748490605131634w73b8d40ax278fac343602123b@mail.gmail.com> (raw)
In-Reply-To: <1147562300.12379.1.camel@pmac.infradead.org>

On 14/05/06, David Woodhouse <dwmw2@infradead.org> wrote:
> On Sun, 2006-05-14 at 01:07 +0200, Jesper Juhl wrote:
> > There are two code paths in drivers/mtd/devices/phram.c::phram_setup() that
> > will leak memory.
> > Memory is allocated to the variable 'name' with kmalloc() by the
> > parse_name() function, but if we leave by way of the parse_err() macro,
> > then that memory is never kfree()'d, nor is it ever used with
> > register_device() so it won't be freed later either - leak.
> >
> > Found by the Coverity checker as #593 - simple fix below.
>
> Applied; thanks. Please Cc me and/or linux-mtd@lists.infradead.org on
> MTD patches.
>
Sure thing, will do. The same problem exists in
drivers/mtd/devices/block2mtd.c, I'm cooking up a patch for that one
as we speak.


> (Ew. The parse_err() macro contains a 'return'. Who do I slap for that?)
>
Want me to fix the macro and the users of it?

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

  reply	other threads:[~2006-05-13 23:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-13 23:07 Jesper Juhl
2006-05-13 23:18 ` David Woodhouse
2006-05-13 23:34   ` Jesper Juhl [this message]
2006-05-13 23:40     ` David Woodhouse
2006-05-14  6:37       ` Jörn Engel
2006-05-14 11:03         ` David Woodhouse
2006-05-14 13:21           ` Jörn Engel
2006-05-14 16:37             ` Ingo Oeser
2006-05-14 20:07               ` Jörn Engel

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=9a8748490605131634w73b8d40ax278fac343602123b@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=psionic@psionic.de \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®