From mboxrd@z Thu Jan 1 00:00:00 1970 From: jay.aurabind@gmail.com (Jay Aurabind) Date: Thu, 08 May 2014 09:24:38 +0530 Subject: large frame size warning when compiling In-Reply-To: <13485.1399481471@turing-police.cc.vt.edu> References: <20140507163608.GA6068@gmail.com> <13485.1399481471@turing-police.cc.vt.edu> Message-ID: <536AFFFE.1090100@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > > Allocating 1K on the stack is indeed evil. Why would you say evil ? I didnt quite get why you meant by that. Is it at some extremes ? 1K is from the default ubuntu 14.04 config. > >> abx500-core.c had an object of struct device being allocated on stack. So >> dynamically allocating it makes the warning go away. Are there any >> implications on using dynamic allocation on this particular code? > > He probably didn't realize or didn't know better. > > Having said that: > >> + dummy_child = kzalloc(sizeof(struct device),GFP_KERNEL); > > There's no kfree() for this. So you introduced a memory leak. My bad! "I successfully operated the patient, but forgot the scissors inside", :D Thanks for pointing out! :) > >> list_for_each_entry(dev_entry, &abx500_list, list) { >> - dummy_child.parent = dev_entry->dev; >> + dummy_child->parent = dev_entry->dev; >> ops = &dev_entry->ops; >> >> if ((ops != NULL) && (ops->dump_all_banks != NULL)) >> - ops->dump_all_banks(&dummy_child); >> + ops->dump_all_banks(dummy_child); >> } > > kfree(dummy_child); /* should go here... */ >> } >> EXPORT_SYMBOL(abx500_dump_all_banks); > > The weird part is that the entries on abx500_list apparently don't > have valid ->parent pointers already, so we have have to invent dummy ones. > > Anybody understand why that's the case? This smells like we're not fixing > the actual problem here, just changing the way we paper it over to be a less > ugly papering over.... > > Waiting to hear from the experts! > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140508/53b0070f/attachment.bin