From: Leon Romanovsky <leonro@xxxxxxxxxxxx> GSI QP is created in the kernel with very strict parameters, there is no possible way that port number will be wrong in such flow. Reviewed-by: Maor Gottlieb <maorg@xxxxxxxxxxxx> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/hw/mlx5/gsi.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c index fbae1c094fe2..40d418153891 100644 --- a/drivers/infiniband/hw/mlx5/gsi.c +++ b/drivers/infiniband/hw/mlx5/gsi.c @@ -122,8 +122,6 @@ struct ib_qp *mlx5_ib_gsi_create_qp(struct ib_pd *pd, int num_qps = 0; int ret; - mlx5_ib_dbg(dev, "creating GSI QP\n"); - if (mlx5_ib_deth_sqpn_cap(dev)) { if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB) @@ -132,14 +130,6 @@ struct ib_qp *mlx5_ib_gsi_create_qp(struct ib_pd *pd, num_qps = MLX5_MAX_PORTS; } - - if (port_num > ARRAY_SIZE(dev->devr.ports) || port_num < 1) { - mlx5_ib_warn(dev, - "invalid port number %d during GSI QP creation\n", - port_num); - return ERR_PTR(-EINVAL); - } - gsi = kzalloc(sizeof(*gsi), GFP_KERNEL); if (!gsi) return ERR_PTR(-ENOMEM); -- 2.25.2