Re: [PATCH net-next] ipv4: fib: use struct_size() in kzalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:51:48 -0600 > 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 fo

[PATCH net-next] ipv4: fib: use struct_size() in kzalloc()

2019-01-30 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; struct boo entry[]; }; instance = kzalloc(sizeof(struc