Re: [PATCH] Input: mcs_touchkey - use struct_size() in kzalloc()

2019-01-14 Thread Gustavo A. R. Silva
On 1/14/19 12:31 AM, Dmitry Torokhov wrote: Signed-off-by: Gustavo A. R. Silva Applied, thank you. Thanks, Dmitry. -- Gustavo

Re: [PATCH] Input: mcs_touchkey - use struct_size() in kzalloc()

2019-01-13 Thread Dmitry Torokhov
On Tue, Jan 08, 2019 at 03:15:56PM -0600, 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

[PATCH] Input: mcs_touchkey - use struct_size() in kzalloc()

2019-01-08 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 = kzalloc(sizeof(struct