[PATCH] revoke: only fput unused files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pekka Enberg <[email protected]>

We should do fput only to files that were not used by the revoke
operation.

Signed-off-by: Pekka Enberg <[email protected]>
---
 fs/revoke.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: uml-2.6/fs/revoke.c
===================================================================
--- uml-2.6.orig/fs/revoke.c	2007-04-19 17:27:11.000000000 +0300
+++ uml-2.6/fs/revoke.c	2007-04-19 17:27:40.000000000 +0300
@@ -130,7 +130,6 @@ 	for (fd = 0; fd < fdt->max_fds; fd++) {
 		}
 
 		new_filp = revoke_table_get(table);
-		get_file(new_filp);
 
 		/*
 		 * Replace original struct file pointer with a pointer to
@@ -487,7 +486,7 @@ static void free_revoke_table(struct rev
 {
 	int i;
 
-	for (i = 0; i < table->size; i++)
+	for (i = table->end; i < table->size; i++)
 		fput(table->files[i]);
 
 	kfree(table->files);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux