Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Trond Myklebust and committed by
Linus Torvalds
a6d85430 baf14aa1

+3 -1
+3 -1
fs/lockd/svclock.c
··· 485 485 return nlm_granted; 486 486 /* Create host handle for callback */ 487 487 host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); 488 - if (host == NULL) 488 + if (host == NULL) { 489 + kfree(conf); 489 490 return nlm_lck_denied_nolocks; 491 + } 490 492 block = nlmsvc_create_block(rqstp, host, file, lock, cookie); 491 493 if (block == NULL) { 492 494 kfree(conf);