提交 a6d85430 编写于 作者: T Trond Myklebust 提交者: Linus Torvalds

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: NTrond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 baf14aa1
...@@ -485,8 +485,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, ...@@ -485,8 +485,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
return nlm_granted; return nlm_granted;
/* Create host handle for callback */ /* Create host handle for callback */
host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len);
if (host == NULL) if (host == NULL) {
kfree(conf);
return nlm_lck_denied_nolocks; return nlm_lck_denied_nolocks;
}
block = nlmsvc_create_block(rqstp, host, file, lock, cookie); block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
if (block == NULL) { if (block == NULL) {
kfree(conf); kfree(conf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册