Re: [PATCH] mtd: rawnand: jz4780: use struct_size() in devm_kzalloc()

2018-09-04 Thread Miquel Raynal
Hi Gustavo, "Gustavo A. R. Silva" wrote on Thu, 23 Aug 2018 14:33:32 -0500: > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: >

Re: [PATCH] mtd: rawnand: jz4780: use struct_size() in devm_kzalloc()

2018-08-23 Thread Kees Cook
On Thu, Aug 23, 2018 at 12:33 PM, Gustavo A. R. Silva wrote: > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct foo { >

Re: [PATCH] mtd: rawnand: jz4780: use struct_size() in devm_kzalloc()

2018-08-23 Thread Boris Brezillon
On Thu, 23 Aug 2018 14:33:32 -0500 "Gustavo A. R. Silva" wrote: > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct foo

[PATCH] mtd: rawnand: jz4780: use struct_size() in devm_kzalloc()

2018-08-23 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = devm_kzalloc(dev,