svn commit: r341899 - stable/11/sys/dev/mlx4/mlx4_core

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 12 11:40:25 UTC 2018


Author: hselasky
Date: Wed Dec 12 11:40:23 2018
New Revision: 341899
URL: https://svnweb.freebsd.org/changeset/base/341899

Log:
  MFC r341542:
  mlx4core: Avoid multiplication overflow by casting multiplication.
  
  Sponsored by:   Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c
==============================================================================
--- stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c	Wed Dec 12 11:40:19 2018	(r341898)
+++ stable/11/sys/dev/mlx4/mlx4_core/mlx4_icm.c	Wed Dec 12 11:40:23 2018	(r341899)
@@ -411,7 +411,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct m
 	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);
 


More information about the svn-src-all mailing list