Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27b3f949b769a208e2849d28e7ad64cadac5d0e3
Commit:     27b3f949b769a208e2849d28e7ad64cadac5d0e3
Parent:     587142f85f796cf0b823dd3080e815f02ff6b952
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 2 10:24:56 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 23:40:38 2007 -0400

    NFSv4: Fix a credential reference leak in nfs4_get_state_owner()
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/nfs4state.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 5d7ffbf..0030248 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -83,7 +83,7 @@ nfs4_client_grab_unused(struct nfs_client *clp, struct 
rpc_cred *cred)
        if (!list_empty(&clp->cl_unused)) {
                sp = list_entry(clp->cl_unused.next, struct nfs4_state_owner, 
so_list);
                atomic_inc(&sp->so_count);
-               sp->so_cred = cred;
+               sp->so_cred = get_rpccred(cred);
                list_move(&sp->so_list, &clp->cl_state_owners);
                clp->cl_nunused--;
        }
@@ -175,7 +175,6 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct 
nfs_server *server, struct
        struct nfs_client *clp = server->nfs_client;
        struct nfs4_state_owner *sp, *new;
 
-       get_rpccred(cred);
        new = nfs4_alloc_state_owner();
        spin_lock(&clp->cl_lock);
        sp = nfs4_find_state_owner(clp, cred);
@@ -185,7 +184,7 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct 
nfs_server *server, struct
                list_add(&new->so_list, &clp->cl_state_owners);
                new->so_client = clp;
                new->so_id = nfs4_alloc_lockowner_id(clp);
-               new->so_cred = cred;
+               new->so_cred = get_rpccred(cred);
                sp = new;
                new = NULL;
        }
@@ -193,7 +192,6 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct 
nfs_server *server, struct
        kfree(new);
        if (sp != NULL)
                return sp;
-       put_rpccred(cred);
        return NULL;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to