android_kernel_xiaomi_sm8350/drivers/infiniband
Roland Dreier c263ff65d5 IB/mthca: Avoid integer overflow when allocating huge ICM table
In mthca_alloc_icm_table(), the number of entries to allocate for the
table->icm array is computed by calculating obj_size * nobj and then
dividing by MTHCA_TABLE_CHUNK_SIZE.  If nobj is really large, then
obj_size * nobj may overflow and the division may get the wrong value
(even a negative value).  Fix this by calculating the number of
objects per chunk and then dividing nobj by this value instead.

This patch allows crazy configurations such as loading ib_mthca with
the module parameter num_mtt=33554432 to work properly.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-16 21:01:13 -07:00
..
core IB/uverbs: Use alloc_file() instead of get_empty_filp() 2008-04-16 21:01:08 -07:00
hw IB/mthca: Avoid integer overflow when allocating huge ICM table 2008-04-16 21:01:13 -07:00
ulp IB/srp: Enforce protocol limit on srp_sg_tablesize 2008-04-16 21:01:12 -07:00
Kconfig RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
Makefile RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00