aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2018-03-19 15:02:35 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-03-19 14:45:17 -0600
commit1f07e08fab2e895c68d4eb5a519c36be75a12078 (patch)
tree677978d240779d885343be695a9b4663a4af954c /drivers/infiniband
parentIB/uverbs: Extend uverbs_ioctl header with driver_id (diff)
downloadlinux-dev-1f07e08fab2e895c68d4eb5a519c36be75a12078.tar.xz
linux-dev-1f07e08fab2e895c68d4eb5a519c36be75a12078.zip
IB/uverbs: Enable compact representation of uverbs_attr_spec
Downstream patches extend uverbs_attr_spec with new fields. In order to save space, we move the type and flags fields to the various attribute flavors contained in the union. Reviewed-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/uverbs_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 7016e729f139..82a1775ba657 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -69,9 +69,9 @@ static int uverbs_process_attr(struct ib_device *ibdev,
switch (spec->type) {
case UVERBS_ATTR_TYPE_PTR_IN:
case UVERBS_ATTR_TYPE_PTR_OUT:
- if (uattr->len < spec->len ||
+ if (uattr->len < spec->ptr.len ||
(!(spec->flags & UVERBS_ATTR_SPEC_F_MIN_SZ) &&
- uattr->len > spec->len))
+ uattr->len > spec->ptr.len))
return -EINVAL;
e->ptr_attr.data = uattr->data;