mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/9] drivers/mfd/88pm860x-i2c.c: introduce missing kfree
Date: Mon, 26 Dec 2011 13:18:54 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1112261318050.1873@localhost6.localdomain6> (raw)
In-Reply-To: <20111226120855.GB17760@sirena.org.uk>

On Mon, 26 Dec 2011, Mark Brown wrote:

> On Fri, Dec 23, 2011 at 06:39:26PM +0100, Julia Lawall wrote:
>> Error handling code following a kzalloc should free the allocated data.  At
>> this point, chip has been allocated and some fields have been initialized,
>> but it has not been stored anywhere, so it should be freed before leaving
>> the function.
>
> With this and probably a bunch of the other corrections in this series a
> conversion to devm_kazlloc() would be a more complete fix as it prevents
> people introducing similar missing cleanup paths in future.  Not sure if
> spatch can generate that automatically though...

I saw a patch for that recently, and looked into it a little bit, but I 
wasn't sure what should be done.  What are the criteria for using 
devm_kzalloc?

julia

  reply	other threads:[~2011-12-26 12:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 17:39 Julia Lawall
2011-12-26 12:08 ` Mark Brown
2011-12-26 12:18   ` Julia Lawall [this message]
2011-12-26 12:20     ` Mark Brown
2011-12-26 13:44   ` devm_kfree Julia Lawall
2011-12-26 14:23     ` devm_kfree Mark Brown
2011-12-26 16:17       ` devm_kfree Julia Lawall
2011-12-26 16:19         ` devm_kfree Mark Brown
2011-12-27  2:48     ` devm_kfree Adam Jiang
2011-12-27  6:10       ` devm_kfree Julia Lawall

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=alpine.DEB.2.02.1112261318050.1873@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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 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®