-
由 Shung-Hsi Yu 提交于
stable inclusion from linux-4.19.144 commit f00d82c3fb4368afb41cba89b287801a7888627c -------------------------------- [ Upstream commit cbedcb04 ] 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: 225c7b1f ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters") Signed-off-by: NShung-Hsi Yu <shung-hsi.yu@suse.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NAichun Li <liaichun@huawei.com> Reviewed-by: Nwangxiaopeng <wangxiaopeng7@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
e111b1fe