]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Use inline data transfer for UHW_IN
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 13 Feb 2018 10:18:30 +0000 (12:18 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Feb 2018 21:59:44 +0000 (14:59 -0700)
commit3ddfb353a45788860e676f79e19dd9e549c0842a
tree067a09af8ce5420766a1e8c6f7af8c1315a355d5
parentc5602def23e41ee39f47961fc8e585add558d70a
IB/uverbs: Use inline data transfer for UHW_IN

The rule for the API is pointers less than 8 bytes are inlined into
the .data field of the attribute. Fix the creation of the driver udata
struct to follow this rule and point to the .data itself when the size
is less than 8 bytes.

Otherwise if the UHW struct is less than 8 bytes the driver will get
EFAULT during copy_from_user.

Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_std_types.c