From 1f07e08fab2e895c68d4eb5a519c36be75a12078 Mon Sep 17 00:00:00 2001 From: Matan Barak Date: Mon, 19 Mar 2018 15:02:35 +0200 Subject: 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 Signed-off-by: Matan Barak Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- drivers/infiniband/core/uverbs_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/infiniband/core/uverbs_ioctl.c') 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; -- cgit v1.2.3-59-g8ed1b