summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-03-14 23:01:50 +0100
committerJason Gunthorpe <jgg@mellanox.com>2018-03-15 22:58:04 +0100
commit7f86260b5f44d93ab20d3e9afda0e3f48d005ffe (patch)
tree9d5b717f71c82069e5f3eabcdf951d3b98fc20a3 /drivers/infiniband
parentRDMA/hns: Use structs to describe the uABI instead of opencoding (diff)
downloadlinux-7f86260b5f44d93ab20d3e9afda0e3f48d005ffe.tar.xz
linux-7f86260b5f44d93ab20d3e9afda0e3f48d005ffe.zip
RDMA/cxgb4: Use structs to describe the uABI instead of opencoding
Open coding a loose value is not acceptable for describing the uABI in RDMA. Provide the missing struct. Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb4/provider.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index 1b5c6cd2ac4d..42568a4df3f8 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -281,7 +281,9 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev,
php->pdid = pdid;
php->rhp = rhp;
if (context) {
- if (ib_copy_to_udata(udata, &php->pdid, sizeof(u32))) {
+ struct c4iw_alloc_pd_resp uresp = {.pdid = php->pdid};
+
+ if (ib_copy_to_udata(udata, &uresp, sizeof(uresp))) {
c4iw_deallocate_pd(&php->ibpd);
return ERR_PTR(-EFAULT);
}