Messages in this thread | | | Subject | Re: [PATCH v2] udf: Use kvzalloc() in udf_sb_alloc_bitmap() | From | Denis Efremov <> | Date | Fri, 28 Aug 2020 01:07:37 +0300 |
| |
On 8/28/20 1:09 AM, Gustavo A. R. Silva wrote: > > > On 8/27/20 16:25, Denis Efremov wrote: >> Use kvzalloc() in udf_sb_alloc_bitmap() instead of open-coding it. >> Size computation wrapped in struct_size() macro to prevent potential >> integer overflows. >> >> Signed-off-by: Denis Efremov <efremov@linux.com> >> --- > > Please, comment here what changed in v2, vn... e.g.: > > Changes in v2: > - Use struct_size() helper. >
Ah, thanks. I added this initially and accidentally regenerated the patch file with format-patch.
> > Why not this: > > bitmap = kvzalloc(struct_size(bitmap, s_block_bitmap, nr_groups), > GFP_KERNEL); > > and you can also get rid of _size_ entirely. >
My bad, I missed that only nr_groups is used down the code.
Thanks, I will resend it as v3.
Denis
| |