IB/mlx5: Return EINVAL when caller specifies too many SGEs
authorChuck Lever <chuck.lever@oracle.com>
Sun, 28 Aug 2016 07:58:34 +0000 (10:58 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 2 Sep 2016 18:11:39 +0000 (14:11 -0400)
The returned value should be EINVAL, because it is caused by wrong
caller and not by internal overflow event.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/qp.c

index 0dd7d93cac95b9e2bba86749b18f83846fa36245..acb3b72e719e2cc26ac09e51175a7989ffa41433 100644 (file)
@@ -3758,7 +3758,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
                num_sge = wr->num_sge;
                if (unlikely(num_sge > qp->sq.max_gs)) {
                        mlx5_ib_warn(dev, "\n");
-                       err = -ENOMEM;
+                       err = -EINVAL;
                        *bad_wr = wr;
                        goto out;
                }