diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 10:55:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-10 10:50:17 -0700 |
commit | a39ebeebe475be5d22aa1f2aeb7ae95c3efe9cd7 (patch) | |
tree | 5758eb344f50019d42023d0311c75e6d83bb7173 /fs | |
parent | b44da25c30867fa71f2cec3334ecfa1e9412dab4 (diff) |
NLM: Fix a memory leak in nlmsvc_testlock
changeset a6d85430424d44e946e0946bfaad607115510989 in upstream
The recent fix for a circular lock dependency unfortunately introduced a
potential memory leak in the event where the call to nlmsvc_lookup_host
fails for some reason.
Thanks to Roel Kluin for spotting this.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svclock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 8c520bff4b5..7b951a2dfbc 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -485,8 +485,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, return nlm_granted; /* Create host handle for callback */ host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); - if (host == NULL) + if (host == NULL) { + kfree(conf); return nlm_lck_denied_nolocks; + } block = nlmsvc_create_block(rqstp, host, file, lock, cookie); if (block == NULL) { kfree(conf); |