diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 72ec59456e69..b55c2a8a547c 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1860,9 +1860,11 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, | |||
1860 | unlock_page(pages[j]); */ | 1860 | unlock_page(pages[j]); */ |
1861 | res = 0; | 1861 | res = 0; |
1862 | out_unmap: | 1862 | out_unmap: |
1863 | if (res > 0) | 1863 | if (res > 0) { |
1864 | for (j=0; j < res; j++) | 1864 | for (j=0; j < res; j++) |
1865 | page_cache_release(pages[j]); | 1865 | page_cache_release(pages[j]); |
1866 | res = 0; | ||
1867 | } | ||
1866 | kfree(pages); | 1868 | kfree(pages); |
1867 | return res; | 1869 | return res; |
1868 | } | 1870 | } |
@@ -1878,8 +1880,6 @@ st_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages, | |||
1878 | for (i=0; i < nr_pages; i++) { | 1880 | for (i=0; i < nr_pages; i++) { |
1879 | struct page *page = sgl[i].page; | 1881 | struct page *page = sgl[i].page; |
1880 | 1882 | ||
1881 | /* XXX: just for debug. Remove when PageReserved is removed */ | ||
1882 | BUG_ON(PageReserved(page)); | ||
1883 | if (dirtied) | 1883 | if (dirtied) |
1884 | SetPageDirty(page); | 1884 | SetPageDirty(page); |
1885 | /* unlock_page(page); */ | 1885 | /* unlock_page(page); */ |