linux/drivers/net/ethernet/mellanox/mlx4
Shung-Hsi Yu cbedcb044e net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
On machines with much memory (> 2 TByte) and log_mtts_per_seg == 0, a
max_order of 31 will be passed to mlx_buddy_init(), which results in
s = BITS_TO_LONGS(1 << 31) becoming a negative value, leading to
kvmalloc_array() failure when it is converted to size_t.

  mlx4_core 0000:b1:00.0: Failed to initialize memory region table, aborting
  mlx4_core: probe of 0000:b1:00.0 failed with error -12

Fix this issue by changing the left shifting operand from a signed literal to
an unsigned one.

Fixes: 225c7b1fee ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-01 13:13:15 -07:00
..
alloc.c mellanox: Switch to bitmap_zalloc() 2019-03-04 10:19:33 -08:00
catas.c mlx4: Split restart_one into two functions 2019-09-13 22:11:14 +02:00
cmd.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
cq.c net/mlx4_core: Fix error handling when initializing CQ bufs in the driver 2019-01-24 21:48:26 -08:00
crdump.c net/mlx4_core: Add missing iounmap() in error path 2020-04-25 20:43:56 -07:00
en_clock.c
en_cq.c
en_dcb_nl.c
en_ethtool.c net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule() 2020-05-07 13:04:21 -07:00
en_main.c
en_netdev.c bpf, xdp: Remove XDP_QUERY_PROG and XDP_QUERY_PROG_HW XDP commands 2020-07-25 20:37:02 -07:00
en_port.c
en_port.h
en_resources.c
en_rx.c net/mlx4: Use fallthrough pseudo-keyword 2020-07-27 13:14:10 -07:00
en_selftest.c
en_tx.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-04-25 20:18:53 -07:00
eq.c net/mlx4: Use fallthrough pseudo-keyword 2020-07-27 13:14:10 -07:00
fw_qos.c
fw_qos.h
fw.c net/mlx4_core: fix a memory leak bug. 2020-05-23 16:34:37 -07:00
fw.h
icm.c net/mlx4: replace pci_{,un}map_sg with dma_{,un}map_sg 2019-01-07 05:14:17 -08:00
icm.h
intf.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-08-02 01:02:12 -07:00
Makefile
mcg.c net/mlx4: Use fallthrough pseudo-keyword 2020-07-27 13:14:10 -07:00
mlx4_en.h mlx4: convert to new udp_tunnel_nic infra 2020-07-10 13:54:00 -07:00
mlx4_stats.h
mlx4.h mlx4: Split restart_one into two functions 2019-09-13 22:11:14 +02:00
mr.c net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init() 2020-09-01 13:13:15 -07:00
pd.c
port.c net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query 2019-05-20 11:33:57 -07:00
profile.c
qp.c
reset.c
resource_tracker.c net/mlx4_core: Dynamically set guaranteed amount of counters per VF 2019-10-29 16:29:43 -07:00
sense.c
srq.c