Messages in this thread | | | Subject | Re: [PATCH] udf: Use kvzalloc() in udf_sb_alloc_bitmap() | From | Joe Perches <> | Date | Thu, 27 Aug 2020 08:49:41 -0700 |
| |
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.
| |