Commit 54ca95eb authored by Oleg Drokin's avatar Oleg Drokin Committed by J. Bruce Fields

Leak in nlmsvc_testlock for async GETFL case

Fix nlm_block leak for the case of supplied blocking lock info.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 8838dc43
...@@ -505,12 +505,12 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, ...@@ -505,12 +505,12 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
goto out; goto out;
} }
if (block->b_flags & B_GOT_CALLBACK) { if (block->b_flags & B_GOT_CALLBACK) {
nlmsvc_unlink_block(block);
if (block->b_fl != NULL if (block->b_fl != NULL
&& block->b_fl->fl_type != F_UNLCK) { && block->b_fl->fl_type != F_UNLCK) {
lock->fl = *block->b_fl; lock->fl = *block->b_fl;
goto conf_lock; goto conf_lock;
} else { } else {
nlmsvc_unlink_block(block);
ret = nlm_granted; ret = nlm_granted;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment