Commit 3c4cb3be authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] fix file_lock_cache leak

Always free the request, not just on error.
parent 156889a0
......@@ -1459,10 +1459,8 @@ int fcntl_setlk(struct file *filp, unsigned int cmd, struct flock *l)
break;
}
out:
if (error) {
locks_free_lock(file_lock);
}
out:
locks_free_lock(file_lock);
return error;
}
......@@ -1601,11 +1599,8 @@ int fcntl_setlk64(struct file *filp, unsigned int cmd, struct flock64 *l)
break;
}
out:
if (error) {
locks_free_lock(file_lock);
}
locks_free_lock(file_lock);
return error;
}
#endif /* BITS_PER_LONG == 32 */
......
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