From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org,
parav@mellanox.com, maorg@mellanox.com, maxg@mellanox.com,
monis@mellanox.com, chuck.lever@oracle.com
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
tianjia.zhang@alibaba.com
Subject: [PATCH] IB/core: Fix wrong return value in _ib_modify_qp()
Date: Sun, 2 Aug 2020 19:15:42 +0800 [thread overview]
Message-ID: <20200802111542.5475-1-tianjia.zhang@linux.alibaba.com> (raw)
On an error exit path, a negative error code should be returned
instead of a positive return value.
Fixes: 7a5c938b9ed09 ("IB/core: Check for rdma_protocol_ib only after validating port_num")
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
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 53d6505c0c7b..f369f0a19e85 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1712,7 +1712,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.26.2
next reply other threads:[~2020-08-02 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-02 11:15 Tianjia Zhang [this message]
2020-08-06 18:13 ` [PATCH] IB/core: Fix wrong return value in _ib_modify_qp() Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200802111542.5475-1-tianjia.zhang@linux.alibaba.com \
--to=tianjia.zhang@linux.alibaba.com \
--cc=chuck.lever@oracle.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@mellanox.com \
--cc=maxg@mellanox.com \
--cc=monis@mellanox.com \
--cc=parav@mellanox.com \
--cc=tianjia.zhang@alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).