Commit e83458fc authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Fix a credential leak in _nfs4_discover_trunking()

Fixes: 4f40a5b5 ("NFSv4: Add an fattr allocation to _nfs4_discover_trunking()")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 85aa8ddc
......@@ -4018,7 +4018,7 @@ static int _nfs4_discover_trunking(struct nfs_server *server,
page = alloc_page(GFP_KERNEL);
if (!page)
return -ENOMEM;
goto out_put_cred;
locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL);
if (!locations)
goto out_free;
......@@ -4040,6 +4040,8 @@ static int _nfs4_discover_trunking(struct nfs_server *server,
kfree(locations);
out_free:
__free_page(page);
out_put_cred:
put_cred(cred);
return status;
}
......
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