projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0184afd
)
RDMA/mlx5: Fix udata response upon SRQ creation
author
Yishai Hadas
<yishaih@mellanox.com>
Mon, 6 Apr 2020 17:35:40 +0000
(20:35 +0300)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Tue, 14 Apr 2020 18:56:34 +0000
(15:56 -0300)
Fix udata response upon SRQ creation to use the UAPI structure (i.e.
mlx5_ib_create_srq_resp). It did not zero the reserved field in userspace.
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Link:
https://lore.kernel.org/r/20200406173540.1466477-1-leon@kernel.org
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/srq.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/mlx5/srq.c
b/drivers/infiniband/hw/mlx5/srq.c
index b1a8a91750400d25e8dbbd31bcb58af58a57877b..6d1ff13d2283c8bd776a668141b397c046a6c669 100644
(file)
--- a/
drivers/infiniband/hw/mlx5/srq.c
+++ b/
drivers/infiniband/hw/mlx5/srq.c
@@
-310,12
+310,18
@@
int mlx5_ib_create_srq(struct ib_srq *ib_srq,
srq->msrq.event = mlx5_ib_srq_event;
srq->ibsrq.ext.xrc.srq_num = srq->msrq.srqn;
- if (udata)
- if (ib_copy_to_udata(udata, &srq->msrq.srqn, sizeof(__u32))) {
+ if (udata) {
+ struct mlx5_ib_create_srq_resp resp = {
+ .srqn = srq->msrq.srqn,
+ };
+
+ if (ib_copy_to_udata(udata, &resp, min(udata->outlen,
+ sizeof(resp)))) {
mlx5_ib_dbg(dev, "copy to user failed\n");
err = -EFAULT;
goto err_core;
}
+ }
init_attr->attr.max_wr = srq->msrq.max - 1;