lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] udf: Use kvzalloc() in udf_sb_alloc_bitmap()
From
Date


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

\
 
 \ /
  Last update: 2020-08-28 00:08    [W:0.038 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site