]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
nlm bugfix added
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Oct 2007 20:40:45 +0000 (13:40 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Oct 2007 20:40:45 +0000 (13:40 -0700)
review-2.6.22/nlm-fix-a-memory-leak-in-nlmsvc_testlock.patch [new file with mode: 0644]
review-2.6.22/series

diff --git a/review-2.6.22/nlm-fix-a-memory-leak-in-nlmsvc_testlock.patch b/review-2.6.22/nlm-fix-a-memory-leak-in-nlmsvc_testlock.patch
new file mode 100644 (file)
index 0000000..c0041c1
--- /dev/null
@@ -0,0 +1,37 @@
+From Trond.Myklebust@netapp.com Tue Oct  9 13:38:43 2007
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Tue, 9 Oct 2007 10:55:45 -0400
+Subject: NLM: Fix a memory leak in nlmsvc_testlock
+Message-Id: <1191943677.8739.14.camel@heimdal.trondhjem.org>
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+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>
+---
+
+ fs/lockd/svclock.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/fs/lockd/svclock.c
++++ b/fs/lockd/svclock.c
+@@ -485,8 +485,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, 
+                       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);
index d193e210829939ccb76acced8b5b830978cc90a2..85f1d02a8bc7094dc61b0a5844ae9f873d6c0174 100644 (file)
@@ -10,3 +10,4 @@ fix-smp-poweroff-hangs.patch
 fix-timer_stats-printout-of-events-sec.patch
 selinux-clear-parent-death-signal-on-sid-transitions.patch
 i386-use-global-flag-to-disable-broken-local-apic-timer-on-amd-cpus.patch
+nlm-fix-a-memory-leak-in-nlmsvc_testlock.patch