diff options
-rw-r--r-- | fs/nfs/dir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c19e16f0b2d0..a00ba92acccc 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -544,6 +544,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en if (scratch == NULL) return -ENOMEM; + if (buflen == 0) + goto out_nopages; + xdr_init_decode_pages(&stream, &buf, xdr_pages, buflen); xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); @@ -565,6 +568,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en break; } while (!entry->eof); +out_nopages: if (count == 0 || (status == -EBADCOOKIE && entry->eof != 0)) { array = nfs_readdir_get_array(page); if (!IS_ERR(array)) { |