diff options
| -rw-r--r-- | net/core/datagram.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index a8a795cfeff5..badcd93e5dd8 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/highmem.h> | 48 | #include <linux/highmem.h> |
| 49 | #include <linux/spinlock.h> | 49 | #include <linux/spinlock.h> |
| 50 | #include <linux/slab.h> | 50 | #include <linux/slab.h> |
| 51 | #include <linux/pagemap.h> | ||
| 51 | 52 | ||
| 52 | #include <net/protocol.h> | 53 | #include <net/protocol.h> |
| 53 | #include <linux/skbuff.h> | 54 | #include <linux/skbuff.h> |
| @@ -638,10 +639,7 @@ int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, | |||
| 638 | return -EMSGSIZE; | 639 | return -EMSGSIZE; |
| 639 | num_pages = get_user_pages_fast(base, size, 0, &page[i]); | 640 | num_pages = get_user_pages_fast(base, size, 0, &page[i]); |
| 640 | if (num_pages != size) { | 641 | if (num_pages != size) { |
| 641 | int j; | 642 | release_pages(&page[i], num_pages, 0); |
| 642 | |||
| 643 | for (j = 0; j < num_pages; j++) | ||
| 644 | put_page(page[i + j]); | ||
| 645 | return -EFAULT; | 643 | return -EFAULT; |
| 646 | } | 644 | } |
| 647 | truesize = size * PAGE_SIZE; | 645 | truesize = size * PAGE_SIZE; |
