diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /lib/iov_iter.c | |
parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/iov_iter.c')
-rw-r--r-- | lib/iov_iter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 52c8dd6d8e82..1c1c06ddc20a 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c | |||
@@ -687,8 +687,10 @@ EXPORT_SYMBOL(_copy_from_iter_full_nocache); | |||
687 | 687 | ||
688 | static inline bool page_copy_sane(struct page *page, size_t offset, size_t n) | 688 | static inline bool page_copy_sane(struct page *page, size_t offset, size_t n) |
689 | { | 689 | { |
690 | size_t v = n + offset; | 690 | struct page *head = compound_head(page); |
691 | if (likely(n <= v && v <= (PAGE_SIZE << compound_order(page)))) | 691 | size_t v = n + offset + page_address(page) - page_address(head); |
692 | |||
693 | if (likely(n <= v && v <= (PAGE_SIZE << compound_order(head)))) | ||
692 | return true; | 694 | return true; |
693 | WARN_ON(1); | 695 | WARN_ON(1); |
694 | return false; | 696 | return false; |