> -----Original Message----- > From: James Bottomley [mailto:James.Bottomley@xxxxxxxxxxxxxxxxxxxxx] > Sent: Friday, May 10, 2013 3:32 PM > To: Seiji Aguchi > Cc: linux-efi@xxxxxxxxxxxxxxx; matt.fleming@xxxxxxxxx; dle-develop@xxxxxxxxxxxxxxxxxxxxx; Tomoki Sekiyama > Subject: Re: [PATCH]Move kzalloc() just before memset() to avoid initializing new sysfs entries wrongly > > 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)? Yes. > 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. OK. I will update my patch. Thank you for reviewing! Seiji -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html