diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2017-01-18 14:10:31 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-06-05 21:17:08 +0100 |
commit | b6d98c338b05e18945f9650e15798d41c91be503 (patch) | |
tree | 9f5cef861bc7e6af0cdcc380858ead34f94322f0 | |
parent | 633eb2ae856cc0faeb9b47b0d1671fcabe66fbfd (diff) | |
download | linux-stable-b6d98c338b05e18945f9650e15798d41c91be503.tar.gz linux-stable-b6d98c338b05e18945f9650e15798d41c91be503.tar.bz2 linux-stable-b6d98c338b05e18945f9650e15798d41c91be503.zip |
IB/mlx5: Return error for unsupported signature type
commit 12bbf1ea7e3b35892dbb8636b978160bc9576b61 upstream.
In case of unsupported singature, we returned positive
value, while the better approach is to return -EINVAL.
In addition, in this change, the error print is enriched
to provide an actual supplied signature type.
Fixes: e6631814fb3a ("IB/mlx5: Support IB_WR_REG_SIG_MR")
Cc: Sagi Grimberg <sagi@grimberg.me>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 3b21d3597be2..74cb286e6012 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -2336,8 +2336,9 @@ static int set_psv_wr(struct ib_sig_domain *domain, break; default: - pr_err("Bad signature type given.\n"); - return 1; + pr_err("Bad signature type (%d) is given.\n", + domain->sig_type); + return -EINVAL; } return 0; |