NFS: Fix a page leak in uncached_readdir()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 20 Nov 2010 18:24:46 +0000 (13:24 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 22 Nov 2010 18:24:45 +0000 (13:24 -0500)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c

index 42e66e9..353f47c 100644 (file)
@@ -763,13 +763,14 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
                goto out;
        }
 
+       desc->page_index = 0;
+       desc->page = page;
+
        if (nfs_readdir_xdr_to_array(desc, page, inode) == -1) {
                status = -EIO;
                goto out_release;
        }
 
-       desc->page_index = 0;
-       desc->page = page;
        status = nfs_do_filldir(desc, dirent, filldir);
 
  out: