linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix file_lock_cache leak
@ 2002-09-27 14:17 Matthew Wilcox
  0 siblings, 0 replies; only message in thread
From: Matthew Wilcox @ 2002-09-27 14:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel


Always free the request, not just on error.

diff -urpNX dontdiff linux-2.5.38/fs/locks.c linux-2.5.38-flock/fs/locks.c
--- linux-2.5.38/fs/locks.c	2002-09-21 18:47:00.000000000 -0700
+++ linux-2.5.38-flock/fs/locks.c	2002-09-26 10:36:16.000000000 -0700
@@ -1459,10 +1470,8 @@ int fcntl_setlk(struct file *filp, unsig
 		break;
 	}
 
-out:
-	if (error) {
-		locks_free_lock(file_lock);
-	}
+ out:
+	locks_free_lock(file_lock);
 	return error;
 }
 
@@ -1601,11 +1614,8 @@ int fcntl_setlk64(struct file *filp, uns
 		break;
 	}
 
-
 out:
-	if (error) {
-		locks_free_lock(file_lock);
-	}
+	locks_free_lock(file_lock);
 	return error;
 }
 #endif /* BITS_PER_LONG == 32 */

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-27 14:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-27 14:17 [PATCH] fix file_lock_cache leak Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).