All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Seiji Aguchi <seiji.aguchi-7rDLJAbr9SE@public.gmane.org>
Cc: "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Tomoki Sekiyama <tomoki.sekiyama-7rDLJAbr9SE@public.gmane.org>
Subject: Re: [PATCH]Move kzalloc() just before memset() to avoid initializing new sysfs entries wrongly
Date: Fri, 10 May 2013 12:31:55 -0700	[thread overview]
Message-ID: <1368214315.2024.20.camel@dabdike> (raw)
In-Reply-To: <A5ED84D3BB3A384992CBB9C77DEDA4D41AFF1979-ohthHghroY0jroPwUH3sq+6wyyQG6/Uh@public.gmane.org>

On Fri, 2013-05-10 at 19:10 +0000, Seiji Aguchi wrote:
> > This is manifestly wrong: it would leak memory as it circulates around
> > the loop.
> 
> I don't think the memory leak happens.
> As you can see below, if  a new entry is not created, kfree() is called outside while(1).

Ah, I see, entry is consumed by efivar_create_sysfs_entry(entry)?  In
that case, saying so in the change log would be helpful plus remove the
memset, which is what implied in the old code that the loop didn't
consume entry and which is rendered superfluous by the kzalloc.

James

  parent reply	other threads:[~2013-05-10 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 18:46 [PATCH]Move kzalloc() just before memset() to avoid initializing new sysfs entries wrongly Seiji Aguchi
     [not found] ` <A5ED84D3BB3A384992CBB9C77DEDA4D41AFF18EF-ohthHghroY0jroPwUH3sq+6wyyQG6/Uh@public.gmane.org>
2013-05-10 19:04   ` James Bottomley
2013-05-10 19:10     ` Seiji Aguchi
     [not found]       ` <A5ED84D3BB3A384992CBB9C77DEDA4D41AFF1979-ohthHghroY0jroPwUH3sq+6wyyQG6/Uh@public.gmane.org>
2013-05-10 19:31         ` James Bottomley [this message]
2013-05-10 19:34           ` Seiji Aguchi

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=1368214315.2024.20.camel@dabdike \
    --to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
    --cc=dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=seiji.aguchi-7rDLJAbr9SE@public.gmane.org \
    --cc=tomoki.sekiyama-7rDLJAbr9SE@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.