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