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 <[email protected]>
---
 fs/cifs/cifssmb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 949e121..5c81cd4 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1667,9 +1667,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);
                }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to