Re: [PATCH] mtd: maps: sa1100-flash: Prefer struct_size over open coded arithmetic

2024-04-09 Thread Miquel Raynal
On Sat, 2024-03-30 at 17:55:35 UTC, Erick Archer wrote: > This is an effort to get rid of all multiplications from allocation > functions in order to prevent integer overflows [1][2]. > > As the "info" variable is a pointer to "struct sa_info" and this > structure ends in a flexible array: > >

[PATCH] mtd: maps: sa1100-flash: Prefer struct_size over open coded arithmetic

2024-03-30 Thread Erick Archer
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1][2]. As the "info" variable is a pointer to "struct sa_info" and this structure ends in a flexible array: struct sa_info { [...] struct sa_subdev_info