Re: [PATCH net-next] cxgb4: smt: use struct_size() in kvzalloc()

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

[PATCH net-next] cxgb4: smt: use struct_size() in kvzalloc()

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 = kvzalloc(sizeof(stru