lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] udf: Use kvzalloc() in udf_sb_alloc_bitmap()
From
Date
On Thu, 2020-08-27 at 18:28 +0300, Denis Efremov wrote:
> > @@ -1013,10 +1013,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
> > size = sizeof(struct udf_bitmap) +
> > (sizeof(struct buffer_head *) * nr_groups);
>
> I missed that this size is a good place to use struct_size for
> overflow checking. I will send v2 instead.

And you could cuddle the

if (!bitmap)
return NULL;

by removing the blank line between the alloc and test.


\
 
 \ /
  Last update: 2020-08-27 17:51    [W:0.168 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site