[PATCH] Fix sys_move_pages when a NULL node list is passed
[pandora-kernel.git] / mm / readahead.c
index aa7ec42..23cb61a 100644 (file)
@@ -38,6 +38,7 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
        ra->ra_pages = mapping->backing_dev_info->ra_pages;
        ra->prev_page = -1;
 }
+EXPORT_SYMBOL_GPL(file_ra_state_init);
 
 /*
  * Return max readahead size for this inode in number-of-pages.
@@ -172,6 +173,8 @@ static int read_pages(struct address_space *mapping, struct file *filp,
 
        if (mapping->a_ops->readpages) {
                ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
+               /* Clean up the remaining pages */
+               put_pages_list(pages);
                goto out;
        }