diff options
Diffstat (limited to 'net/ceph/pagevec.c')
-rw-r--r-- | net/ceph/pagevec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 01947a5d03b7..1a040e64c69f 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c | |||
@@ -26,12 +26,12 @@ struct page **ceph_get_direct_page_vector(const char __user *data, | |||
26 | rc = get_user_pages(current, current->mm, (unsigned long)data, | 26 | rc = get_user_pages(current, current->mm, (unsigned long)data, |
27 | num_pages, write_page, 0, pages, NULL); | 27 | num_pages, write_page, 0, pages, NULL); |
28 | up_read(¤t->mm->mmap_sem); | 28 | up_read(¤t->mm->mmap_sem); |
29 | if (rc < 0) | 29 | if (rc < num_pages) |
30 | goto fail; | 30 | goto fail; |
31 | return pages; | 31 | return pages; |
32 | 32 | ||
33 | fail: | 33 | fail: |
34 | kfree(pages); | 34 | ceph_put_page_vector(pages, rc > 0 ? rc : 0, false); |
35 | return ERR_PTR(rc); | 35 | return ERR_PTR(rc); |
36 | } | 36 | } |
37 | EXPORT_SYMBOL(ceph_get_direct_page_vector); | 37 | EXPORT_SYMBOL(ceph_get_direct_page_vector); |