aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-11-25 20:58:40 +0200
committerDoug Ledford <dledford@redhat.com>2018-12-03 12:01:58 -0500
commit40efca7a46a04223e6792fbe23ba337f54cff794 (patch)
treed38e9dd58acd7a67086ab8f75fdcaf545c221726 /drivers/infiniband/core
parentRDMA/uverbs: Use uverbs_request() and core for write_ex handlers (diff)
downloadlinux-dev-40efca7a46a04223e6792fbe23ba337f54cff794.tar.xz
linux-dev-40efca7a46a04223e6792fbe23ba337f54cff794.zip
RDMA/uverbs: Fill in the response for IB_USER_VERBS_EX_CMD_MODIFY_QP
A response struct was defined, and userspace is providing it (but not checking it). Fill it in and write it out. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 7f8b0a7dcb17..c605412708b8 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1953,6 +1953,9 @@ static int ib_uverbs_ex_modify_qp(struct uverbs_attr_bundle *attrs,
struct ib_udata *ucore)
{
struct ib_uverbs_ex_modify_qp cmd;
+ struct ib_uverbs_ex_modify_qp_resp resp = {
+ .response_length = uverbs_response_length(attrs, sizeof(resp))
+ };
int ret;
ret = uverbs_request(attrs, &cmd, sizeof(cmd));
@@ -1969,7 +1972,11 @@ static int ib_uverbs_ex_modify_qp(struct uverbs_attr_bundle *attrs,
~((IB_USER_LAST_QP_ATTR_MASK << 1) - 1))
return -EOPNOTSUPP;
- return modify_qp(attrs, &cmd);
+ ret = modify_qp(attrs, &cmd);
+ if (ret)
+ return ret;
+
+ return uverbs_response(attrs, &resp, sizeof(resp));
}
static int ib_uverbs_destroy_qp(struct uverbs_attr_bundle *attrs,