Skip to content
Commit 0804db3a authored by Mark Bloch's avatar Mark Bloch Committed by Paul Gortmaker
Browse files

RDMA/mlx4: Read pkey table length instead of hardcoded value

commit ec78b3bd upstream.

If the pkey_table is not available (which is the case when RoCE is not
supported), the cited commit caused a regression where mlx4_devices
without RoCE are not created.

Fix this by returning a pkey table length of zero in procedure
eth_link_query_port() if the pkey-table length reported by the device is
zero.

Link: https://lore.kernel.org/r/20200824110229.1094376-1-leon@kernel.org


Cc: <stable@vger.kernel.org>
Fixes: 1901b91f ("IB/core: Fix potential NULL pointer dereference in pkey cache")
Fixes: fa417f7b ("IB/mlx4: Add support for IBoE")
Signed-off-by: default avatarMark Bloch <markb@mellanox.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@nvidia.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent dbe99bc8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment