diff options
| author | Eli Cohen <eli@dev.mellanox.co.il> | 2014-12-11 10:04:15 -0500 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2014-12-15 21:13:35 -0500 |
| commit | 5a77abf9a97a7ecc8fb0f6bf4ad411fb12b02f31 (patch) | |
| tree | 2fbcf2c088cde299781ef0104c165f595aebd415 /include/rdma | |
| parent | c1395a2a8c01e8a919e47d64eb3d23d00e824b8b (diff) | |
IB/core: Add support for extended query device caps
Add extensible query device capabilities verb to allow adding new features.
ib_uverbs_ex_query_device is added and copy_query_dev_fields is used to
copy capability fields to be used by both ib_uverbs_query_device and
ib_uverbs_ex_query_device.
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/rdma')
| -rw-r--r-- | include/rdma/ib_verbs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 470a011d6fa4..97a999f9e4d8 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -1662,7 +1662,10 @@ static inline int ib_copy_from_udata(void *dest, struct ib_udata *udata, size_t | |||
| 1662 | 1662 | ||
| 1663 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) | 1663 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) |
| 1664 | { | 1664 | { |
| 1665 | return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; | 1665 | size_t copy_sz; |
| 1666 | |||
| 1667 | copy_sz = min_t(size_t, len, udata->outlen); | ||
| 1668 | return copy_to_user(udata->outbuf, src, copy_sz) ? -EFAULT : 0; | ||
| 1666 | } | 1669 | } |
| 1667 | 1670 | ||
| 1668 | /** | 1671 | /** |
