Skip to contentSkip to conversation

fix file_lock_cache leak

PATCH New Matthew Wilcox 1 participant 1 message Sep 27, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix file_lock_cache leak

Always free the request, not just on error.

fs/locks.c +3 -8
diff -urpNX dontdiff linux-2.5.38/fs/locks.c linux-2.5.38-flock/fs/locks.c
@@ -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 */
Signature · 1 line
Revolutions do not require corporate support.