RDMA/mlx5: Delete impossible inlen check
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 27 Apr 2020 15:46:25 +0000 (18:46 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 30 Apr 2020 21:45:44 +0000 (18:45 -0300)
The inlen is set to be above zero in all flows before
and can't be negative at this stage.

Link: https://lore.kernel.org/r/20200427154636.381474-26-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/qp.c

index 74f09cd..5a43128 100644 (file)
@@ -2107,11 +2107,6 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
                qp->flags &= ~IB_QP_CREATE_PCI_WRITE_END_PADDING;
        }
 
-       if (inlen < 0) {
-               err = -EINVAL;
-               goto err;
-       }
-
        if (init_attr->qp_type == IB_QPT_RAW_PACKET ||
            qp->flags & IB_QP_CREATE_SOURCE_QPN) {
                qp->raw_packet_qp.sq.ubuffer.buf_addr = ucmd->sq_buf_addr;
@@ -2156,8 +2151,6 @@ err_create:
                destroy_qp_user(dev, pd, qp, base, udata);
        else
                destroy_qp_kernel(dev, qp);
-
-err:
        kvfree(in);
        return err;
 }