Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 11:40:24 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r341899 - stable/11/sys/dev/mlx4/mlx4_core
Message-ID:  <201812121140.wBCBeOgE052343@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121140.wBCBeOgE052343>