On Sunday 12 April 2009, Grant Likely wrote: > > + info = kzalloc(sizeof(struct of_flash) + > > + sizeof(struct of_flash_list) * count, GFP_KERNEL); > > + if (!info) > > + goto err_out; > > + > > + mtd_list = kzalloc(sizeof(struct mtd_info) * count, GFP_KERNEL); > > Typically I prefer to see a single kzalloc in a driver which allocates > all the space needed in one go because it simplifies the error/unwind > path.
In general ack, but it doesn't make much sense in this case. The 2nd malloc is for an temporary buffer needed for mtd_concat_create() call (list of struct mtd_info. I can't really combine those two areas. So I'll leave this untouched. Best regards, Stefan _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev