aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 11:04:57 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-09 15:38:26 -0400
commita6d85430424d44e946e0946bfaad607115510989 (patch)
treef324085c0d92fb8ebae928bab3a5f0b480a3bb4a
parentbaf14aa14efcfdb5a74d5cf804691086c6bec743 (diff)
NLM: Fix a memory leak in nlmsvc_testlock
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>
-rw-r--r--fs/lockd/svclock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index d098c7af0d22..d120ec39bcb0 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,
485 return nlm_granted; 485 return nlm_granted;
486 /* Create host handle for callback */ 486 /* Create host handle for callback */
487 host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); 487 host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len);
488 if (host == NULL) 488 if (host == NULL) {
489 kfree(conf);
489 return nlm_lck_denied_nolocks; 490 return nlm_lck_denied_nolocks;
491 }
490 block = nlmsvc_create_block(rqstp, host, file, lock, cookie); 492 block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
491 if (block == NULL) { 493 if (block == NULL) {
492 kfree(conf); 494 kfree(conf);