Commit 9b5415b5 authored by Trond Myklebust's avatar Trond Myklebust

NFS: Fix a use-before-initialised warning in fs/nfs/write.c and fs/nfs/pnfs.c

If the allocation of nfs_write_header fails, the list of nfs_pages that
needs to be cleaned up is still on desc->pg_list...
Reported-by: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: default avatarFred Isaman <iisaman@netapp.com>
parent 80a16b21
...@@ -1308,7 +1308,7 @@ pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) ...@@ -1308,7 +1308,7 @@ pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
whdr = nfs_writehdr_alloc(); whdr = nfs_writehdr_alloc();
if (!whdr) { if (!whdr) {
desc->pg_completion_ops->error_cleanup(&hdr->pages); desc->pg_completion_ops->error_cleanup(&desc->pg_list);
put_lseg(desc->pg_lseg); put_lseg(desc->pg_lseg);
desc->pg_lseg = NULL; desc->pg_lseg = NULL;
return -ENOMEM; return -ENOMEM;
......
...@@ -1164,7 +1164,7 @@ static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) ...@@ -1164,7 +1164,7 @@ static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
whdr = nfs_writehdr_alloc(); whdr = nfs_writehdr_alloc();
if (!whdr) { if (!whdr) {
desc->pg_completion_ops->error_cleanup(&hdr->pages); desc->pg_completion_ops->error_cleanup(&desc->pg_list);
return -ENOMEM; return -ENOMEM;
} }
hdr = &whdr->header; hdr = &whdr->header;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment