diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-03-03 16:13:29 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-03-03 16:13:29 -0500 |
commit | 8d75da8afd068fa58b35e69c7c8c46770d9e7a98 (patch) | |
tree | 9bec3e2fb1334df46403073e260795d8fd9bf156 /fs/nfsd/nfs4callback.c | |
parent | ccdb357ccb77cc4cbe4f7abee9efd19957f0753a (diff) |
nfsd4: fix minor memory leak
There's no need to allocate this cred more than once.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 8fa412ce8021..4bc22c763de7 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -525,6 +525,8 @@ static struct rpc_cred *callback_cred; | |||
525 | 525 | ||
526 | int set_callback_cred(void) | 526 | int set_callback_cred(void) |
527 | { | 527 | { |
528 | if (callback_cred) | ||
529 | return 0; | ||
528 | callback_cred = rpc_lookup_machine_cred(); | 530 | callback_cred = rpc_lookup_machine_cred(); |
529 | if (!callback_cred) | 531 | if (!callback_cred) |
530 | return -ENOMEM; | 532 | return -ENOMEM; |