summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorLi Heng <liheng40@huawei.com>2020-07-25 10:56:27 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-19 08:14:59 +0200
commitb6be0b71eaaa2eb71d87d29f2775c74a36d320ad (patch)
treefab3c78cb516d9737cacf89c1ccb2697a174883a /drivers/infiniband/core
parente3e983b327e7f2456c6d72c7942dcbb1a91160af (diff)
downloadlinux-b6be0b71eaaa2eb71d87d29f2775c74a36d320ad.tar.gz
linux-b6be0b71eaaa2eb71d87d29f2775c74a36d320ad.tar.bz2
linux-b6be0b71eaaa2eb71d87d29f2775c74a36d320ad.zip
RDMA/core: Fix return error value in _ib_modify_qp() to negative
[ Upstream commit 47fda651d5af2506deac57d54887cf55ce26e244 ] The error codes in _ib_modify_qp() are supposed to be negative errno. Fixes: 7a5c938b9ed0 ("IB/core: Check for rdma_protocol_ib only after validating port_num") Link: https://lore.kernel.org/r/1595645787-20375-1-git-send-email-liheng40@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Li Heng <liheng40@huawei.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/verbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 82f309fb3ce5..e8432876cc86 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1617,7 +1617,7 @@ static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr,
if (!(rdma_protocol_ib(qp->device,
attr->alt_ah_attr.port_num) &&
rdma_protocol_ib(qp->device, port))) {
- ret = EINVAL;
+ ret = -EINVAL;
goto out;
}
}