diff options
Diffstat (limited to 'include/rdma/ib_verbs.h')
| -rw-r--r-- | include/rdma/ib_verbs.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0d74f1de99aa..65994a19e840 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -1707,10 +1707,7 @@ static inline int ib_copy_from_udata(void *dest, struct ib_udata *udata, size_t | |||
| 1707 | 1707 | ||
| 1708 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) | 1708 | static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) |
| 1709 | { | 1709 | { |
| 1710 | size_t copy_sz; | 1710 | return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; |
| 1711 | |||
| 1712 | copy_sz = min_t(size_t, len, udata->outlen); | ||
| 1713 | return copy_to_user(udata->outbuf, src, copy_sz) ? -EFAULT : 0; | ||
| 1714 | } | 1711 | } |
| 1715 | 1712 | ||
| 1716 | /** | 1713 | /** |
