Skip to content

Commit 4bab6d9

Browse files
Dan Carpenterjgunthorpe
authored andcommitted
RDMA/irdma: Fix positive vs negative error codes in irdma_post_send()
This code accidentally returns positive EINVAL instead of negative -EINVAL. Some of the callers treat positive returns as success. Add the missing '-' char. Fixes: a24a29c ("RDMA/irdma: Add Atomic Operations support") Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 7fcf00b commit 4bab6d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,7 +3966,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
39663966
case IB_WR_ATOMIC_CMP_AND_SWP:
39673967
if (unlikely(!(dev->hw_attrs.uk_attrs.feature_flags &
39683968
IRDMA_FEATURE_ATOMIC_OPS))) {
3969-
err = EINVAL;
3969+
err = -EINVAL;
39703970
break;
39713971
}
39723972
info.op_type = IRDMA_OP_TYPE_ATOMIC_COMPARE_AND_SWAP;
@@ -3983,7 +3983,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
39833983
case IB_WR_ATOMIC_FETCH_AND_ADD:
39843984
if (unlikely(!(dev->hw_attrs.uk_attrs.feature_flags &
39853985
IRDMA_FEATURE_ATOMIC_OPS))) {
3986-
err = EINVAL;
3986+
err = -EINVAL;
39873987
break;
39883988
}
39893989
info.op_type = IRDMA_OP_TYPE_ATOMIC_FETCH_AND_ADD;

0 commit comments

Comments
 (0)