diff -up ./fs/locks.c.flnulldfix ./fs/locks.c
--- ./fs/locks.c.flnulldfix	2009-08-14 16:20:43.000000000 +0400
+++ ./fs/locks.c	2009-08-21 19:30:52.000000000 +0400
@@ -152,12 +152,12 @@ static struct file_lock *locks_alloc_loc
 	struct file_lock *fl;
 
 	fl = kmem_cache_alloc(filelock_cache, SLAB_KERNEL);
+	if (fl == NULL)
+		goto out;
 #ifdef CONFIG_VE
 	fl->fl_notpid = 0;
 #endif
 #ifdef CONFIG_USER_RESOURCE
-	if (fl == NULL)
-		goto out;
 	fl->fl_charged = 0;
 	if (!charge)
 		goto out;
@@ -166,8 +166,8 @@ static struct file_lock *locks_alloc_loc
 
 	kmem_cache_free(filelock_cache, fl);
 	fl = NULL;
-out:
 #endif
+out:
 	return fl;
 }
 
