summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-10-21 10:14:04 +0400
committerSteve French <smfrench@gmail.com>2011-10-21 18:21:04 +0400
commita2d6b6cacb4fd4494b4037c01abb1332cefbb37b (patch)
tree0357c72de853c8f7760200e617712f8ac2999fb7
parentb957ae9c53d5715a07f8bac644d8ff0a407c7e07 (diff)
downloadlinux-a2d6b6cacb4fd4494b4037c01abb1332cefbb37b.tar.xz
CIFS: Fix error handling in cifs_readv_complete
In cifs_readv_receive we don't update rdata->result to error value after kmap'ing a page. We should kunmap the page in the no error case only. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/cifssmb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index aaad4ce6e6c5..4435b11c41b9 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1619,9 +1619,9 @@ cifs_readv_complete(struct work_struct *work)
list_for_each_entry_safe(page, tpage, &rdata->pages, lru) {
list_del(&page->lru);
lru_cache_add_file(page);
- kunmap(page);
if (rdata->result == 0) {
+ kunmap(page);
flush_dcache_page(page);
SetPageUptodate(page);
}