mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
mlx4core: Avoid multiplication overflow by casting multiplication.
Submitted by: hselasky@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
318bd2348c
commit
601e19f00a
1 changed files with 1 additions and 1 deletions
|
|
@ -411,7 +411,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
|
|||
size = (u64) nobj * obj_size;
|
||||
for (i = 0; i * MLX4_TABLE_CHUNK_SIZE < reserved * obj_size; ++i) {
|
||||
chunk_size = MLX4_TABLE_CHUNK_SIZE;
|
||||
if ((i + 1) * MLX4_TABLE_CHUNK_SIZE > size)
|
||||
if ((u64) (i + 1) * MLX4_TABLE_CHUNK_SIZE > size)
|
||||
chunk_size = PAGE_ALIGN(size -
|
||||
i * MLX4_TABLE_CHUNK_SIZE);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue