Skip to content

Commit e83458f

Browse files
author
Trond Myklebust
committed
NFSv4: Fix a credential leak in _nfs4_discover_trunking()
Fixes: 4f40a5b ("NFSv4: Add an fattr allocation to _nfs4_discover_trunking()") Signed-off-by: Trond Myklebust <[email protected]>
1 parent 85aa8dd commit e83458f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfs/nfs4proc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,7 @@ static int _nfs4_discover_trunking(struct nfs_server *server,
40184018

40194019
page = alloc_page(GFP_KERNEL);
40204020
if (!page)
4021-
return -ENOMEM;
4021+
goto out_put_cred;
40224022
locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL);
40234023
if (!locations)
40244024
goto out_free;
@@ -4040,6 +4040,8 @@ static int _nfs4_discover_trunking(struct nfs_server *server,
40404040
kfree(locations);
40414041
out_free:
40424042
__free_page(page);
4043+
out_put_cred:
4044+
put_cred(cred);
40434045
return status;
40444046
}
40454047

0 commit comments

Comments
 (0)