]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix file_lock_cache leak
authorMatthew Wilcox <willy@debian.org>
Fri, 27 Sep 2002 01:55:59 +0000 (18:55 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 27 Sep 2002 01:55:59 +0000 (18:55 -0700)
Always free the request, not just on error.

fs/locks.c

index ab969a790fcad01eaa8bbf6491ffa4f2eea9c4b7..75b13e9bf5886a7898153dea2297e3e6bc12b96a 100644 (file)
@@ -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 */