diff options
author | Matan Barak <matanb@mellanox.com> | 2018-03-19 15:02:35 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-03-19 14:45:17 -0600 |
commit | 1f07e08fab2e895c68d4eb5a519c36be75a12078 (patch) | |
tree | 677978d240779d885343be695a9b4663a4af954c /drivers/infiniband/core/uverbs_ioctl.c | |
parent | 0ede73bc012c98fba244b33efbc42e48dd23ee9a (diff) | |
download | linux-1f07e08fab2e895c68d4eb5a519c36be75a12078.tar.bz2 |
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/core/uverbs_ioctl.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_ioctl.c | 4 |
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; |