summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-12-02 23:32:44 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-02 23:32:44 +0100
commit2741049e66d9698da5e0c90c849406fa3d3fc45c (patch)
tree725c927121ccfe3eaa7df3b9b8e46610805f6b15 /drivers/scsi/sg.c
parent[PATCH] Fix TIF_POLLING_NRFLAG in ACPI idle routines (diff)
parent[SCSI] sg: fix a bug in st_map_user_pages failure path (diff)
downloadlinux-2741049e66d9698da5e0c90c849406fa3d3fc45c.tar.xz
linux-2741049e66d9698da5e0c90c849406fa3d3fc45c.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c6
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,
unlock_page(pages[j]); */
res = 0;
out_unmap:
- if (res > 0)
+ if (res > 0) {
for (j=0; j < res; j++)
page_cache_release(pages[j]);
+ res = 0;
+ }
kfree(pages);
return res;
}
@@ -1878,8 +1880,6 @@ st_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages,
for (i=0; i < nr_pages; i++) {
struct page *page = sgl[i].page;
- /* XXX: just for debug. Remove when PageReserved is removed */
- BUG_ON(PageReserved(page));
if (dirtied)
SetPageDirty(page);
/* unlock_page(page); */