From: Samuel Ortiz <sameo@linux.intel.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-kernel@vger.kernel.org, Graeme Gregory <gg@slimlogic.co.uk>,
Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Subject: Re: [PATCH] mfd: Don't leak init_data in tps65910_i2c_probe
Date: Mon, 4 Jul 2011 19:33:20 +0200 [thread overview]
Message-ID: <20110704173320.GR3021@sortiz-mobl> (raw)
In-Reply-To: <alpine.LNX.2.00.1107022120171.16316@swampdragon.chaosbits.net>
Hi Jesper,
On Sat, Jul 02, 2011 at 09:21:38PM +0200, Jesper Juhl wrote:
> There are a couple of situations where we leak init_data in
> drivers/mfd/tps65910.c:tps65910_i2c_probe() - this patch should take
> care of them.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> drivers/mfd/tps65910.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> Compile tested only.
>
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index 2229e66..0db62f4 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -144,15 +144,17 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
> return -EINVAL;
>
> init_data = kzalloc(sizeof(struct tps65910_platform_data), GFP_KERNEL);
> - if (init_data == NULL)
> + if (!init_data)
This is not a memory leak fix. And I actually prefer the == NULL check.
Please remove the == NULL check replacement with !* and keep only the memory
leak fixing part.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
next prev parent reply other threads:[~2011-07-04 17:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-02 19:21 [PATCH] mfd: Don't leak init_data in tps65910_i2c_probe Jesper Juhl
2011-07-04 17:33 ` Samuel Ortiz [this message]
2011-07-05 7:46 ` Jesper Juhl
2011-07-05 22:29 ` Jesper Juhl
2011-07-05 22:54 ` Graeme Gregory
2011-07-06 18:34 ` Samuel Ortiz
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=20110704173320.GR3021@sortiz-mobl \
--to=sameo@linux.intel.com \
--cc=gg@slimlogic.co.uk \
--cc=jedu@slimlogic.co.uk \
--cc=jj@chaosbits.net \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox