aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2012-02-09 11:52:50 -0500
committerRoland Dreier <roland@purestorage.com>2012-02-26 04:37:30 -0500
commit4ba6b8eaa9d67d03fb653cb8a13afca3236d4d70 (patch)
tree529ac43cf579467c0552fcd102bd8c5764472786 /drivers/infiniband
parent6b21d18ed50c7d145220b0724ea7f2613abf0f95 (diff)
IB/mlx4: Set bad_wr for invalid send opcode
If the opcode of a work request exceeds the range of valid opcodes, return the pointer to the offending work request. Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index aa2aefa4236..3a784896662 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1884,6 +1884,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1884 wmb(); 1884 wmb();
1885 1885
1886 if (wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mlx4_ib_opcode)) { 1886 if (wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mlx4_ib_opcode)) {
1887 *bad_wr = wr;
1887 err = -EINVAL; 1888 err = -EINVAL;
1888 goto out; 1889 goto out;
1889 } 1890 }