Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-03-12 Thread Gustavo A. R. Silva
On 3/12/19 2:33 PM, Christoph Hellwig wrote: > Thanks, > > applied to nvme-5.2. > Great. Thanks, Christoph. -- Gustavo

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-03-12 Thread Christoph Hellwig
Thanks, applied to nvme-5.2.

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-03-08 Thread James Smart
On 2/23/2019 10:51 AM, Gustavo A. R. Silva wrote: Update the code to use a zero-sized array instead of a pointer in structure nvmet_fc_tgt_queue and use struct_size() in kzalloc(). Notice that one of the more common cases of allocation size calculations is finding the size of a structure that ha

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-03-08 Thread Christoph Hellwig
James, can you take a look at this one? On Sat, Feb 23, 2019 at 12:51:08PM -0600, Gustavo A. R. Silva wrote: > Update the code to use a zero-sized array instead of a pointer in > structure nvmet_fc_tgt_queue and use struct_size() in kzalloc(). > > Notice that one of the more common cases of alloc

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-02-23 Thread Gustavo A. R. Silva
On 2/23/19 2:28 PM, Gustavo A. R. Silva wrote: > Hey Joe, > > On 2/23/19 2:05 PM, Joe Perches wrote: >> On Sat, 2019-02-23 at 12:51 -0600, Gustavo A. R. Silva wrote: >>> Update the code to use a zero-sized array instead of a pointer in >>> structure nvmet_fc_tgt_queue and use struct_size() in k

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-02-23 Thread Gustavo A. R. Silva
Hey Joe, On 2/23/19 2:05 PM, Joe Perches wrote: > On Sat, 2019-02-23 at 12:51 -0600, Gustavo A. R. Silva wrote: >> Update the code to use a zero-sized array instead of a pointer in >> structure nvmet_fc_tgt_queue and use struct_size() in kzalloc(). > [] >> This code was detected with the help of C

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-02-23 Thread Joe Perches
On Sat, 2019-02-23 at 12:51 -0600, Gustavo A. R. Silva wrote: > Update the code to use a zero-sized array instead of a pointer in > structure nvmet_fc_tgt_queue and use struct_size() in kzalloc(). [] > This code was detected with the help of Coccinelle. Really? Impressive script that found this on

[PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-02-23 Thread Gustavo A. R. Silva
Update the code to use a zero-sized array instead of a pointer in structure nvmet_fc_tgt_queue and use struct_size() in kzalloc(). Notice that 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 f