| From 7893703ab9da083a5b9d398f9491ffd42c62b279 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Sat, 25 Jul 2020 10:56:27 +0800 |
| Subject: RDMA/core: Fix return error value in _ib_modify_qp() to negative |
| |
| From: Li Heng <liheng40@huawei.com> |
| |
| [ 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> |
| --- |
| drivers/infiniband/core/verbs.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c |
| index 56a71337112c5..cf45fd704671f 100644 |
| --- a/drivers/infiniband/core/verbs.c |
| +++ b/drivers/infiniband/core/verbs.c |
| @@ -1659,7 +1659,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; |
| } |
| } |
| -- |
| 2.25.1 |
| |